www.webdeveloper.com
Results 1 to 2 of 2

Thread: jQ stop() and clearQueue

  1. #1
    Join Date
    Nov 2005
    Location
    Bundanoon: first village to ban bottled water
    Posts
    218

    jQ stop() and clearQueue

    Hi Colleagues,

    Having trouble getting jQuery stop() working.

    The architecture is:

    Main page:
    menu div
    and
    #loadit div, into which the menu links load html pages.

    The loaded pages:
    <div>
    several identical-sized images in a stack, z-indexed;
    several text overlays
    </div>

    The function on the menu link, eg doPage1(), fades in and out images and text, with appropriate delays and transition speeds.

    We need to kill the animation currently running when the viewer switches to a new menu link. I think applying stop() to the div within #loadit should kill the animation, but the syntax I've tried doesn't do it, eg
    $('#loadit.div').stop().doPage1() or $('#loadit div').stop().doPage1()

    Also, is the correct syntax of clearQueue $('#whatever').stop('true') ?


    This is getting urgent: what was previously an amateur inhouse project is now to go online and I need to find a solution quick.

    Cheers!

  2. #2
    Join Date
    Aug 2008
    Location
    Sweden
    Posts
    227
    Hi ctoz,

    stop() just stops the animation - it does not finish nor reset the style of the animated elements, which might have given you weird results. Also note that stop() doesn't affect underlying elements. (So if you're animating images and text overlays inside the div(s) then those won't stop.)

    To answer your second question, stop(clearQueue) expects a boolean true - not a string.

    (Also note that $('#loadit.div') will look for any element with the ID "loadit" and the class "div".)
    New to web development or in need of a good reference? Check out the Mozilla Developer Network or W3Schools.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles