RennaNoëlle
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by RennaNoëlle
-
-
Hi everyone!
I've been trying to make a slideshow with a pause button.
But now that I got the slideshow working, the pause button won't..
Here is my code:
$(function(){ var $slides = $(".slide"); var currentSlide = 0; var $pauseBtn = $("#pausebtn"); TweenLite.set($slides.filter(":gt(0)"), {left:"960px"}); TweenLite.delayedCall(4, nextSlide); function nextSlide(){ TweenLite.to( $slides.eq(currentSlide), 1, {left:"-960px"} ); if (currentSlide < $slides.length - 1) { currentSlide++; } else { currentSlide = 0; } TweenLite.fromTo( $slides.eq(currentSlide), 1, {left: "960px"}, {left:"0px"} ); TweenLite.delayedCall(4, nextSlide); } $pauseBtn.click(function() { nextSlide.stop(); }); });
Can anyone tell me why this won't work? I got the Uncaught TypeError: nextSlide.stop is not a function(…)
Thanks in advance!
Renna
Pause/ play button slideshow
in GSAP
Posted
Hi Dipscom,
I made a CodePen of the slideshow:
See the Pen BQyoPW by RennaNV (@RennaNV) on CodePen
, thanks for the tip!