Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var slideCaptions = $('.slideCaptions > .slides');
- var slideImages = $('.slideImages > .slides');
- var slideHeadlines = $('.slideHeadlines > .slides');
- var delay = 3000;
- var speed = 800;
- var slidesInterval = setInterval( showNext, delay );
- function resetInterval() { // Resets the slide interval so that when next/previous is clicked, the show doesn't automatically move to the next slide immediately
- clearInterval(slidesInterval);
- setTimeout( function() {
- slidesInterval = setInterval( showNext, delay );
- });
- };
- slideCaptions.slideshow({
- transition: 'fadeThroughBackground',
- autoStyle: true,
- duration:speed,
- autoPlay: false
- });
- slideImages.slideshow({
- transition: 'push(left, false, ease)',
- autoStyle: true,
- duration: speed,
- autoPlay: false
- });
- slideHeadlines.slideshow({
- transition: 'push(right, false, ease)',
- autoStyle: true,
- duration: speed,
- autoPlay: false
- });
- function showNext() {
- slideImages.slideshow( 'show', 'next' );
- slideHeadlines.slideshow( 'show', 'next' );
- slideCaptions.slideshow( 'show', 'next');
- };
- $( '.sliderNext' ).click(function(){ // Next control
- resetInterval();
- slideImages.slideshow( 'show', 'next' );
- slideCaptions.slideshow( 'show', 'next');
- slideHeadlines.slideshow( 'show', 'next', {
- transition:'push(right)'
- } )
- });
- $( '.sliderPrev' ).click(function(){ // Previous control
- resetInterval();
- slideImages.slideshow( 'show', 'previous', {
- transition:'push(right)'
- } );
- slideCaptions.slideshow( 'show', 'previous');
- slideHeadlines.slideshow( 'show', 'previous', {
- transition:'push(left)'
- } );
- });
- $( '.hero' ).hover(
- function() {clearInterval(slidesInterval); console.log("Hovered")},
- function() {resetInterval(); console.log("Exited")}
- )
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement