Right to Left (RTL)
This section contains an image that scrolls horizontally (right to left, left to right, or a combination). The horizontal scroll is acheived using thedirection
attribute, which moves the image from right to left or left to right as required.Slide-In Images
This image slides in from the right then stops. You will need to refresh this page to see the effect again.Example:
Continuous Image Scroll (RTL)
To make the image scroll continuously, we simply change the value of thebehavior
attribute to scroll
(i.e. behavior="scroll"
).Example:
Faster Scrolling
This example usesscrollamount="30"
to increase the scroll speed.Faster scrolling works better on continuous scrolling as opposed to slide-in images. This is because slide-in images stop after sliding in. If it slides in too fast, many users might miss the slide-in effect altogether.
Example:Left to Right (LTR)
Slide-In Image
This image slides in from the left, then stays where it is. You will need to refresh this page to see the effect again.Example:
Continuous Image Scroll (LTR)
Again, we change thebehavior
attribute to scroll
in order to make the image scroll continuously.Example:
Faster Scrolling
This example usesscrollamount="30"
to increase the scroll speed.Example:
Image bouncing back and forth:
Normal Speed
This image bounces at the default speed.Example:
Faster Bounce
This example usesscrollamount="30"
to speed up the scrolling/bouncing image.Example:
Code:
Image Scrolling Up:
This image has a vertical scroll - it starts at the bottom and moves up. As with some of the previous examples, you can adjust the scroll speed by using thescrollamount
attribute. You could also create a vertical slide by using behavior="slide"
.Example:
Images Scrolling Down:
This image also has a vertical scroll, but this time it starts at the top and moves down.Example:
Various Scrolling Speeds:
This example demonstrates 3 different scrolling speeds.Example:
Jumping Images
The following example uses thescrolldelay
attribute to slow the scrolling image down and make it look like it's jumping across the screen. Actually, the example also uses the scrollamount
attribute to increase the size of each jump.Example:
Marquee Attributes
The<marquee>
tag accepts a number of attributes (some of which are included in the above examples). Feel free to experiment with these settings to see the effect they have on your scrolling images. The full list of attributes are:width | Sets the width of the marquee | scrollamount | How far to jump as it moves |
height | Sets the height of the marquee | loop | How many times it should loop |
direction | Sets the direction of the marquee | bgcolor | Sets the background color of the marquee |
behavior | Whether to slide, bounce, or scroll | hspace | Sets the amount of horizontal space around the marquee |
scrolldelay | How long the marquee should wait before each jump | vspace | Sets the amount of vertical space around the marquee |