Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set current slide correctly when resizing window. Do not start slides…

…how if resizing window and show is paused.
  • Loading branch information...
commit 09094c359915c7eed0e8ad4b5d9e7ad7ad853f8d 1 parent 91a5a10
@jarmo authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 public/hackersays.js
View
8 public/hackersays.js
@@ -41,7 +41,11 @@ $(function() {
$(window).resize(function() {
clearTimeout(reloadTimer);
- reloadTimer = setTimeout(function() { slider.reloadShow() }, 100);
+ reloadTimer = setTimeout(function() {
+ sliderOptions.startingSlide = slider.getCurrentSlide();
+ slider.destroyShow();
+ slider = quotesEl.bxSlider(sliderOptions);
+ }, 100);
});
if (quotesEl.hasClass("via-link")) $("#toolbar .play").click();
@@ -56,6 +60,8 @@ $(function() {
.toggleClass("hide-prev", index == 0)
.toggleClass("hide-next", index == total);
+ if ($("#toolbar .play").hasClass("paused")) return;
+
if (total - index == 5) loadNewQuotes();
clearTimeout(readingTimer);
readingTimer = setTimeout(function() {
Please sign in to comment.
Something went wrong with that request. Please try again.