Results 1 to 9 of 9

Thread: how to stop marquee on mouseover???

  1. #1
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Question how to stop marquee on mouseover???

    how do u stop marquee on mouseover??

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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?

  3. #3
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Default

    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.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Some simple javascript events are required (which requires that the client's browser is javascript enabled):

    HTML Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I didn't know Firefox now supports the marquee tag too.

    IllustriousLyts, you may also want to see this page for a list of marquee properties and methods, in IE at least.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That link is interesting dd - it says that you can do this:

    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    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.

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There's always the <noscript> tag for alternate content in situations like these.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Jul 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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
    Last edited by jscheuer1; 12-26-2010 at 03:24 AM. Reason: remove unauthorized sig

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •