Forum Settings
Forums
New
Dec 23, 2014 1:02 PM
#1

Offline
Feb 2010
11294
This topic is part of our CSS Tutorials and Add-ons section:
http://myanimelist.net/forum/?topicid=419405




Here's a CSS trick for an animated scrolling banner for your list like in the example above. It is much smoother on your list, and I'm still finding ways to improve it. I got this trick from Hahaido's Tips to style your layout. Visit that page for more unique tricks and layouts:
http://myanimelist.net/forum/?topicid=443937&show=60#msg21075029

How to use and customize, and how to fix possible errors



Codes (see spoiler above before using)

/* ANIMATED SCROLLING BANNER
Z-index is the position of the scrolling pic (in front of or behind the list). A high z-index will move the list in front of other parts. A lower index will move the scrollbar behind other parts (-1 will be behind most lists).

If you have errors, you need to remove the #inlineContent codes from other parts of your layout before using these codes. Also read the special instructions on position in the next section below.
*/
#inlineContent {
position: fixed;
display: block !important;
left: 0;
top: 0;
width: 100%;
height: 145px;
overflow: hidden;
z-index: 10;
}

/* SCROLLING IMAGE
Change image and animation speeds here (20s).

For fixing errors, try to replace the '-200%' after "100% { background-position" with a negative px amount equal to the width of your banner image. Also try to replace the '300%' after the first and only "width" below with the full px width of the banner image you use. You should see the width of your banner when you create it or by clicking view image over it wherever its uploaded.
*/
#inlineContent:before {
pointer-events: none;
position: absolute;
content: '';
width: 300%;
height: 100%;
background-image: url("http://i.imgur.com/OIagBWN.png");
-moz-animation: scroll 50s linear infinite;
-webkit-animation: scroll 50s linear infinite;
}


@-moz-keyframes scroll
{
0% { background-position: 0; }
100% { background-position: -200%; }
}

@-webkit-keyframes scroll
{
0% { background-position: 0; }
100% { background-position: -200%; }
}

/* LOWER WALLPAPER
Lower the body wallpaper here so that your animated banner doesn't cover up the top of it.
*/
body {
background-position: 0 145px !important;
}



If you use this, be sure to post your layout with the scrolling banner you make and if you find any tips to improve smoothness of the animation let us know!
Shishio-kunSep 1, 2016 9:20 PM
Reply Disabled for Non-Club Members
Jan 31, 2015 7:07 PM
#2

Offline
Dec 2014
194
Hey, when I try to put in the script for the scrolling banner, the banner is vertical through the middle of my page. Tried changing the selector around, but when I got it horizontal nothing was clickable and the list was nonfunctional.

here is my image



it is 145px height.

I was able to get it to work with different layout, but I couldn't find where the differences in the code were.

My current anime list that works, no scrolling banner.




here is the one that worked with the banner




This is a picture of the other layout.

Feb 1, 2015 6:42 AM
#3

Offline
Sep 2010
703
I don't want the scrollbar to overlap everything, I want to have it in a different row and stay there, but I don't know how to.. =/
Myanimelist
Feb 1, 2015 7:17 AM
#4

Offline
Jan 2012
1578
Could you show an example of what you actually want?
Feb 1, 2015 7:27 AM
#5

Offline
Sep 2010
703
Feb 1, 2015 7:39 AM
#6

Offline
Jan 2012
1578
So all you need is a banner that don't overlap top menu?
Feb 1, 2015 7:58 AM
#7

Offline
Sep 2010
703
Hahaido said:
So all you need is a banner that don't overlap top menu?

exactly
Feb 1, 2015 8:06 AM
#8

Offline
Jan 2012
1578
What the problem? Just move down all menus, that's it
Feb 1, 2015 10:38 AM
#9

Offline
Sep 2010
703
Okay, now it's one thing left, I don't want it to follow when I scroll.

Sorry that I annoy you, I'm new in this xD
Feb 1, 2015 11:27 AM

Offline
Jan 2012
1578
Just change
position: fixed;

to
position: absolute;
Feb 1, 2015 11:46 AM

Offline
Dec 2014
194
Do you have any idea what might be wrong in my css?
Feb 1, 2015 11:48 AM

Offline
Oct 2012
2406
The girl in that scroll image... what anime is she from?
Feb 1, 2015 11:50 AM

Offline
Dec 2012
16302
HidamariSeashore said:
The girl in that scroll image... what anime is she from?
http://myanimelist.net/character/120579/Muramasa_Sandaime
Feb 1, 2015 12:06 PM

Offline
Sep 2010
703
Hahaido said:
Just change
position: fixed;

to
position: absolute;

It turned into this :O
Feb 1, 2015 12:25 PM

Offline
Dec 2014
194
Tsiox said:
Hahaido said:
Just change

to

It turned into this :O



I used your script for the banner on my anime list and manga list.


I still don't know why it puts the banner down the middle of the screen repeated on the anime one. Could it be conflicting positions of images or the list?
Feb 2, 2015 9:38 AM

Offline
Dec 2014
194
I at least found where the problem lies.... it's in the table or header code. I got it to work with everything else when deleted the custom lists. Its working on my manga list with a different background, still can't get it on my anime list though
Feb 4, 2015 1:58 PM

Offline
Feb 2010
11294
willierocks said:
Hey, when I try to put in the script for the scrolling banner, the banner is vertical through the middle of my page. Tried changing the selector around, but when I got it horizontal nothing was clickable and the list was nonfunctional.


Great banner!

You have a problem with it because you have an inline content code in your CSS already. You have to remove that in order to properly use the banner or u get the conflict. I pointed this out in the topic already but I'll try to make it clearer and I'll put this bit of info it in the code itself too, so this error doesn't happen later to other people

I think you also want to lower the z-index to -1 so it moves behind the buttons and stuff.
Shishio-kunFeb 4, 2015 2:14 PM
Feb 4, 2015 2:27 PM

Offline
Feb 2010
11294
Rothrock said:
HidamariSeashore said:
The girl in that scroll image... what anime is she from?
http://myanimelist.net/character/120579/Muramasa_Sandaime


If anyone's ever wondering, this is where I got most of the pics in the bar of this character; NSFW tho. And I hope we see her animated someday!
https://danbooru.donmai.us/posts?tags=sansei_muramasa

Ecchi fans will also like that link, I bet.
Feb 5, 2015 6:58 AM

Offline
Dec 2014
194
Thanks Shishio! I had the remove inline content mixed up. I thought you meant change it in the code you were giving us haha. I can't believe it was something that simple :P
Thanks for your hard work :)
Feb 10, 2015 11:06 AM

Offline
Aug 2014
70729
Hey!
I have my scrolling image and it works, but it keeps jumping back to the start when it's about half way done scrolling through. Is there any way to fix that?
My list: http://myanimelist.net/animelist/Ardanaz

I'm using a gif for the scrolling image. I did it with a normal .png first and that worked better, but after a while it would also jump back.

The CSS:
Feb 10, 2015 2:57 PM

Offline
Feb 2010
11294
Ardanaz said:
Hey!
I have my scrolling image and it works, but it keeps jumping back to the start when it's about half way done scrolling through. Is there any way to fix that?
My list: http://myanimelist.net/animelist/Ardanaz

I'm using a gif for the scrolling image. I did it with a normal .png first and that worked better, but after a while it would also jump back.

The CSS:


I don't remember how you fix that and don't have time to test it out atm, but I'd suggested saving the original code then messing with the width, then the background position and animation speed codes. Might take a lot of testing
Shishio-kunFeb 10, 2015 3:00 PM
Feb 10, 2015 5:09 PM

Offline
Dec 2014
194
Hey Ardanaz... seeing you everywhere lol. You have a blank spot at the end of your gif. I think that might be the reason.


yours



mine
Feb 10, 2015 10:53 PM

Offline
Aug 2014
70729
I got rid of the white part at the end.
Still not working though :(

I'll try messing around a bit more with the code when I get home.
Feb 10, 2015 11:04 PM

Offline
Jan 2012
1578
Fix your code in following places

/* SCROLLING IMAGE
Change image and animation speeds here (20s).
*/
#inlineContent:before {
pointer-events: none;
position: absolute;
content: '';
width: 4675px;
height: 100%;
background-image: url("http://i.imgur.com/8czxYph.gif");
-moz-animation: scroll 20s linear infinite;
-webkit-animation: scroll 20s linear infinite;
}


@-moz-keyframes scroll
{
0% { background-position: 0; }
100% { background-position: -4675px; }
}

@-webkit-keyframes scroll
{
0% { background-position: 0; }
100% { background-position: -4675px; }
}


don't specify image width in percent, write it in px, and always use actual size
Feb 11, 2015 12:40 AM

Offline
Feb 2010
11294
Hahaido said:
Fix your code in following places

/* SCROLLING IMAGE
Change image and animation speeds here (20s).
*/
#inlineContent:before {
pointer-events: none;
position: absolute;
content: '';
width: 4675px;
height: 100%;
background-image: url("http://i.imgur.com/8czxYph.gif");
-moz-animation: scroll 20s linear infinite;
-webkit-animation: scroll 20s linear infinite;
}


@-moz-keyframes scroll
{
0% { background-position: 0; }
100% { background-position: -4675px; }
}

@-webkit-keyframes scroll
{
0% { background-position: 0; }
100% { background-position: -4675px; }
}


don't specify image width in percent, write it in px, and always use actual size


Oh so the px of those parts in bold should always equal the length of the GIF? I'll put that in the opening post later
Feb 11, 2015 12:55 AM

Offline
Jan 2012
1578
To see full image you have to specify it full width. But it's necessary only for background-position property
Feb 11, 2015 1:39 AM

Offline
Feb 2010
11294
ok I've added special instructions to the opening post, thanks!
Feb 11, 2015 5:56 AM

Offline
Aug 2014
70729
Reply Disabled for Non-Club Members

More topics from this board

» ❓ Ask for help here + See Frequently Asked Questions ( 1 2 3 4 5 ... Last Page )

Shishio-kun - Apr 15, 2010

7812 by mtsRhea »»
Apr 21, 5:25 AM

» [CSS- MODERN] ⭐ Minimal Dashboard layout by 5cm ~ Compact and convenient! ( 1 2 3 )

Shishio-kun - Sep 4, 2020

121 by Pokitaru »»
Apr 21, 3:25 AM

» [CSS-MODERN] Change list text/font colors on any list layout

Shishio-kun - May 4, 2021

3 by hideso »»
Apr 20, 4:33 PM

» [CSS] [VIDEO GUIDE] ⭐️ How to change fonts on a list layout

Shishio-kun - Jul 15, 2019

17 by hideso »»
Apr 20, 4:03 PM

» [CSS][Modern] ☀️ Endless Summer Layout by Cateinya ( 1 2 3 4 5 ... Last Page )

Cateinya - Aug 18, 2016

309 by hideso »»
Apr 20, 3:56 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login