Web Development

General discussion


marquee tag

By davoud ·

I undersatnd that W3C does not validate a page with a marquee tag because of accessibility problems. I also believe that marquee tag is a microsoft invention and is not a standard html tag.

However because it is easy to use, I really like to use it. Now my question is that, is there anyway to apply a 2 or 3 seconds pause between the scrolling images in the marquee tag?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

not a fancy answer...

by rmjrenneboog In reply to marquee tag

Perhaps the simplest way to get a two or three second break between messages in a marquee is to set the time attribute within the marquee tags to specify the lag time between messages.

Or you could add a bunch of spaces to the message being displayed. These can be added at the beginning or the end of the message.
I'm not entirely sure why you would want to do this, though. In my experience with marquee (which is admittedly limited) any messages I've used have scrolled off before the next one begins. We have removed the marquee features from our website recently, because it is indeed an accessibility issue.
There is one other way to add 'white space' to a marquee message using spaces, but it assumes that the message repeats as a continuous stream; that is, that the lag time between messages is zero, so that the first character of the second message appears right next to the last character of the first message. Split the message in two, switch them about, and add the desired number of spaces between the two message pieces. Then use the new 'messed up' text string as your message. When it is being shown in marquee, it should appear as the desired message with a white space delay.

Collapse -

Try a "fly-in" effect

by bschaettle In reply to marquee tag

Instead of <MARQUEE> try using some DHTML and IE-specific style-sheet effects. I think you can get a start by searching for "fly-in" on the MSDN site.

Here's one article that may help you:


Collapse -


by davoud In reply to Try a "fly-in" effect

Thanks alot for both of you for your messages. I will try your suggestions later on.

What if I want to add a pause on each picture just like a slide show with a pause on each pic.

Collapse -

Use setTimeout

by bschaettle In reply to marquee

Use the setTimeout feature in JavaScript.
Here's an example that will pause 5 seconds between refreshes:

<SCRIPT Language="JavaScript">
Assumes you have 12 photo files named
"photo_1.jpg", "photo_2.jpg", ..."photo_12.jpg"
var iCount=0;
function ChangePicture() {
// re-set the counter
if (iCount > 12) { iCount = 1; }
// change the image source
// change the picture in another 5 seconds
setTimeout("ChangePicture()", 5000);
<BODY onLoad='setTimeout("ChangePicture()", 5000);'>
<img id="mypicture" src="photo_1.jpg">

Collapse -

by davoud In reply to Use setTimeout

great, thanks very much. best wishes.

Related Discussions

Related Forums