Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed minor "bug" where stopAuto() doesn't work while carousel is animating #49

Closed
wants to merge 2 commits into from

3 participants

@BradBuckingham

Hi Jan,

I'm not sure if this is a "bug" or not, but I've updated the jcarousel so that stopAuto() works as expected (at least how I expect it to work) when called while the carousel is animating. Let me know what you think.

Thanks,
Brad

@BradBuckingham

Minor "oops", I forgot to remove a call to "console.log" on line 454. Sorry!

@jsor
Owner

Hi,

maybe its just to early in the morning, but could you explain it a little bit more. I don't get what the changes actually fix.

Thanks, Jan

@BradBuckingham

Sure,

You can see the "bug" in one of the examples on your site (http://sorgalla.com/projects/jcarousel/examples/static_auto.html)

To replicate: mouseover an image while they are moving (this is a bit tricky because the images move so quickly, but it isn't that hard to do). Leave your mouse over the image and you'll see that the autoscrolling continues despite the fact that your mouse is currently hovering over an image.

Does this make sense?

Brad

@jsor
Owner

Fix stopAuto() not stopping while in animation (Closed by 9d0390e). Fix based on report by Brad Buckingham, http://github.com/jsor/jcarousel/pull/49

@jsor
Owner

Thanks for the report, i got it :)
I hope you don't mind that i didn't applied your patches but fixed it myself in a simpler way.

Thanks, Jan

@BradBuckingham

Jan,

That's fine with me - I had thought that you'd know how to write the fix better than me anyway. I wrote the patch so that the carousel would work just for me without thinking about all other possible configurations.

Thanks,
Brad

@BorisCarvajal

I'm looking here trying to solve an issue related to this report.
stopAuto() only gets executed/works between the carousel animations, never while the animation is running. I think the expected behavior is the carousel immediately stops scrolling.

Regards,
Boris

@jsor
Owner

No, it does not stop the animation. It only stops autoscrolling, thus the name stopAuto.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 23, 2010
Commits on Sep 24, 2010
  1. Forgot to remove a call to 'console.log'. Oops!

    Brad Buckingham authored
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 2 deletions.
  1. +13 −2 lib/jquery.jcarousel.js
View
15 lib/jquery.jcarousel.js
@@ -237,6 +237,7 @@
this.timer = null;
this.tail = null;
this.inTail = false;
+ this.haltOnNext = false;
if (this.locked)
return;
@@ -449,6 +450,11 @@
next: function() {
this.stopAuto();
+ if (this.haltOnNext) {
+ this.haltOnNext = false;
+ return;
+ }
+
if (this.tail != null && !this.inTail)
this.scrollTail(false);
else
@@ -732,8 +738,13 @@
* @return undefined
*/
stopAuto: function() {
- if (this.timer == null)
- return;
+ if (this.timer == null) {
+ if (this.animating) {
+ this.haltOnNext = true;
+ }
+
+ return;
+ }
clearTimeout(this.timer);
this.timer = null;
Something went wrong with that request. Please try again.