Advertisement
Guest User

Untitled

a guest
Apr 13th, 2012
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.     var delay = 5000;
  3.     var speed = 800;
  4.    
  5.     var slidesInterval = setInterval( showNext, delay );
  6.     function resetInterval() { // Resets the slide interval so that when next/previous is clicked, the show doesn't automatically move to the next slide immediately       
  7.         clearInterval(slidesInterval);
  8.         setTimeout( function() {
  9.             slidesInterval = setInterval( showNext, delay );
  10.         });
  11.     };
  12.    
  13.     $('.sliderNav a').fadeTo(750,.1);
  14.    
  15.     var slideCaptions = $('.slideCaptions > .slides').slideshow({
  16.         transition: 'fadeThroughBackground',
  17.         autoStyle: true,
  18.         duration:speed,
  19.         autoPlay: false
  20.     }).data('slideshow');
  21.    
  22.     var slideImages = $('.slideImages > .slides').slideshow({
  23.         transition: 'push(left, false, ease)',
  24.         autoStyle: true,
  25.         duration: speed,
  26.         autoPlay: false
  27.     }).data('slideshow');
  28.  
  29.     var slideHeadlines = $('.slideHeadlines > .slides').slideshow({
  30.         transition: 'push(right, false, ease)',
  31.         autoStyle: true,
  32.         duration: speed,
  33.         autoPlay: false
  34.     }).data('slideshow');
  35.  
  36.     function showNext() {
  37.         slideImages.show( 'next' );
  38.         slideHeadlines.show( 'next' );
  39.         slideCaptions.show( 'next');
  40.     };
  41.  
  42.     $( '.sliderNext' ).click(function(){ // Next control
  43.         clearInterval(slidesInterval);
  44.        
  45.         slideImages.show( 'next' );
  46.         slideCaptions.show( 'next');
  47.         slideHeadlines.show( 'next', {
  48.             transition:'push(right)'
  49.         } )
  50.     });
  51.  
  52.     $( '.sliderPrev' ).click(function(){ // Previous control
  53.         clearInterval(slidesInterval);
  54.  
  55.         slideImages.show( 'previous', {
  56.             transition:'push(right)'
  57.         } );
  58.         slideCaptions.show( 'previous');
  59.         slideHeadlines.show( 'previous', {
  60.             transition:'push(left)'
  61.         } );
  62.     });
  63.    
  64.     $( '.hero' ).hover( // Pauses the slideshow on hover; resumes on de-hover
  65.         function() {clearInterval(slidesInterval); $( '.sliderNav a').fadeTo(100,1); },
  66.         function() {resetInterval(); $( '.sliderNav a').fadeTo(750, .1); }     
  67.     )
  68. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement