Log in

View Full Version : how to stop marquee on mouseover???



ModernRevolutions
09-17-2006, 11:40 PM
how do u stop marquee on mouseover??

ddadmin
09-18-2006, 03:29 AM
Please be more descriptive. Do you mean the <marquee> tag of IE, or a custom DHTML marquee? If the later, what's the URL to it?

ModernRevolutions
09-18-2006, 08:59 PM
ok i have this code:

<MARQUEE>
my text here
</MARQUEE>
and it moves from right to left and loops, i want it to stop on mouseover and then start back up when you take your mouse away from it.


i want to make it stop when you hover over it.

jscheuer1
09-19-2006, 07:24 AM
Some simple javascript events are required (which requires that the client's browser is javascript enabled):


<marquee onmouseover="this.setAttribute('scrollamount', 0, 0);" onmouseout="this.setAttribute('scrollamount', 6, 0);">
my text here
</marquee>

The marquee tag was originally IE specific. It is now supported in limited fashion in some other browsers. FireFox will behave the same as IE for the above example. Opera will reset the marquee to the beginning. Many browsers will do nothing at all, some will not even scroll the marquee to begin with.

If you want more consistent cross browser support and control over a marquee type effect, use a purely javascript marquee.

ddadmin
09-19-2006, 10:14 AM
I didn't know Firefox now supports the marquee tag too.

IllustriousLyts, you may also want to see this page (http://www.javascriptkit.com/javatutors/marquee3.shtml) for a list of marquee properties and methods, in IE at least.

jscheuer1
09-20-2006, 12:54 AM
That link is interesting dd - it says that you can do this:


<marquee onmouseover="this.stop();" onmouseout="this.start();">
my text here
</marquee>

Which works well in IE and FF. Still no go in Opera but, at least it does nothing, instead of resetting the marquee position to the beginning point which, is what my previous version does in Opera.

Still, just about anyone would be better off using a javascript marquee like:

http://home.comcast.net/~jscheuer1/side/marqueeh.htm

for example. There are many others.

blm126
09-20-2006, 01:02 AM
The downfall of your javascript is that if javascript is disabled the contents are not displayed. But with the marque tag if the browser does not support it it will probably just display it like normal. The best solution would be a script that found div or spans with a certain idenifier(like a class name or ID) and would scroll them.

jscheuer1
09-20-2006, 03:05 AM
There's always the <noscript> tag for alternate content in situations like these.

drluv888
12-25-2010, 10:03 PM
hello to all friends

I'm from iran

you can use of this

<marquee onmouseover="stop()" onmouseout="start()">
my text here 2
</marquee>


it's better than of them
have a good time