Bug Tracker

Ticket #3381 (closed bug: invalid)

Opened 6 years ago

Last modified 5 years ago

Queue bug?

Reported by: populus Owned by:
Priority: major Milestone: 1.3
Component: effects Version: 1.2.6
Keywords: Cc: populus, flesler
Blocking: Blocked by:

Description

The following code causes problems with queueing. If I click the left button, then click right button two or more times while the animation is still going on, then the entire queue for 'right click' is executing simultaneously

$("div#container div.slider #left").click(function()

{

sr.queue( function()

{

alert(sr.css('left') + " " + (-$(this).width())+'px'); if ($(this).css('left') < '0px') {

$(this).animate({'left': '+=600px'}, 1000);

} $(this).dequeue();

}

);

}

);

$(document).keydown(function(e)

{

if (e.keyCode == 37) {

$("div#container div.slider #left").click();

} else if (e.keyCode == 39) {

$("div#container div.slider #right").click();

}

}

);

Change History

comment:1 Changed 6 years ago by populus

my mistake! Wrong section of code posted

$("div#container div.slider #right").click(function()

{

sr.queue( function()

{

alert($(this).css('left') > (-$(this).width() + 600)+'px'); if ($(this).css('left') > (-$(this).width() + 600)+'px') {

$(this).animate({'left': '-=600px'}, 1000);

} $(this).dequeue();

}

);

}

);

$("div#container div.slider #left").click(function()

{

sr.queue( function()

{

alert($(this).css('left') < '0px'); if ($(this).css('left') < '0px') {

$(this).animate({'left': '+=600px'}, 1000);

} $(this).dequeue();

}

);

}

);

comment:2 Changed 6 years ago by flesler

  • Cc populus, flesler added
  • need changed from Review to Test Case
  • Component changed from unfilled to fx
  • Owner flesler deleted

Can you make a test case out of this ? one html file with the required js & css. Thanks

comment:3 Changed 5 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

Please reopen and attach a test case if the problem is still there. Also check out the .stop() method if you need to terminate an effect prematurely.

 http://docs.jquery.com/Effects/stop#clearQueuegotoEnd

Note: See TracTickets for help on using tickets.