Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop button on first slide doesn't work #169

Closed
ghost opened this issue Sep 10, 2010 · 11 comments
Closed

Stop button on first slide doesn't work #169

ghost opened this issue Sep 10, 2010 · 11 comments

Comments

@ghost
Copy link

ghost commented Sep 10, 2010

In a multi-panel slideshow, the stop button on the first slide has to be hit twice to stop the autoscroll before proceeding. After the first side changes the stop button works fine.

@tipiirai
Copy link
Contributor

I did some changes earlier for the autoscroll plugin. Can you try with the latest one:

http://github.com/jquerytools/jquerytools/raw/9a2e203e5b7cd9f5e48c383dd78017ca9866ea13/src/scrollable/scrollable.autoscroll.js

How does that work?

@ghost
Copy link
Author

ghost commented Sep 11, 2010

Thanks tipiirai,

I linked your script (after the jquery tools), and got an alert (that I inserted) after

var t = $.tools.scrollable;

but the stop (and pause) functions were never reached. So I presume that there's something wrong with registering $.fn.autoscroll, or with my configuration.

My stop button code is:

Stop

  • Henrik

@tipiirai
Copy link
Contributor

you are speaking of scrollable but your code refers to tabs and the slideshow plugin:

$(".slidetabs").data("slideshow").stop();

for scrollable the correct way to stop is

$(".scrollable").data("scrollable").stop();

@ghost
Copy link
Author

ghost commented Sep 12, 2010

My apologies, I did not appreciate that they are separate plugins. I was using "autoscroll" in the generic behavioral sense, thinking there would be only one plugin involved, not as a plugin name.

The problem I'm having is with the slideshow plugin.

I'll modify the original bug report accordingly to refer to slideshow not autoscroll.

Thanks for the clarification.

  • Henrik

@thompo
Copy link

thompo commented Sep 16, 2010

I too am having this same issue with the slideshow plugin. It absolutely makes this script unusable in a commercial setting and I hope it is resolved soon.

@tipiirai
Copy link
Contributor

I'm using this file here on github:

http://github.com/jquerytools/jquerytools/blob/master/test/tabs/slideshow.htm

when I load the page and immediately hit the stop button after the page loads the slideshow won't proceed.

have you tried with the latest version?

http://github.com/jquerytools/jquerytools/raw/master/src/tabs/tabs.slideshow.js

@ghost
Copy link
Author

ghost commented Sep 19, 2010

Latest version no difference. It's a subtle intermittent problem, and not always on the first slide. Can't get to the bottom of it.

Here's my setup, in case you can see anything: http://pastie.org/1167576

With this setup, I can reliably reproduce the problem by hitting Play, Next, and Stop in rapid succession. This causes the Stop to fail, in case that gives you (or anyone) a clue.

Presumably a subtle timing issue, and interaction among the two timers.

I wondered if timer or startTimer could ever have a 0 (zero) value, and therefore read false for the pause function entry condition. Logically possible, but I doubt it.

Update:

The demo at http://flowplayer.org/tools/demos/tabs/slideshow.html exhibits the same behaviour: click on Next and Stop in rapid succession - Stop fails.

  • Henrik

@ghost
Copy link
Author

ghost commented Sep 19, 2010

I've tried a number of things, and have a theory that clearInterval for startTimer does not stop a startTimer method already underway. IOW does the startTimer method check "stopped" before it starts the slideshow timer? (the startTimer function is not defined in tabs,slideshow.js).

Does this make any sense?

  • Henrik

@tipiirai
Copy link
Contributor

I have now completely refactored the code. here is the commit:

http://github.com/jquerytools/jquerytools/commit/6f3192f748a3ec1b3496737f898cd412e5bd627b

and here is the new file:

http://github.com/jquerytools/jquerytools/raw/6f3192f748a3ec1b3496737f898cd412e5bd627b/src/scrollable/scrollable.autoscroll.js

please let me know how it works for you.

thanks

@ghost
Copy link
Author

ghost commented Sep 20, 2010

That seems to work fine.

I configured my test page thus:

<script type="text/javascript" src="pub/dynamiclayout/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="pub/dynamiclayout/jquery.tools.subset.min.js"></script>
<script type="text/javascript" src="pub/dynamiclayout/tabs.slideshow.js"></script>
<script type="text/javascript" src="pub/dynamiclayout/scrollable.autoscroll.js"></script>
<script type="text/javascript" src="pub/dynamiclayout/toolbox.history.js"></script>

The JQuery Tools subset is:

Tabs, Scrollable with Navigator plugin, and Mousewheel. The history plugin (not needed for this test anyway) is configured separately as I've changed that code to deal with the trailing "#" problem.

As a test, I modified the play button to include immediate next() thus:

<button onClick='$(".slidetabs").data("tabs").next();$(".slidetabs").data("slideshow").play();'>Play</button>

... which works fine.

Very nice, and thanks!

What's the protocol around here? Should I deploy as is, or will there be an updated version integrating these changes shortly?

Thanks again,

  • Henrik

@tipiirai
Copy link
Contributor

I'll be publishing 1.2.5 this/next week.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants