Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- var delay = 5000;
- 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 );
- });
- };
- $('.sliderNav a').fadeTo(750,.1);
- var slideCaptions = $('.slideCaptions > .slides').slideshow({
- transition: 'fadeThroughBackground',
- autoStyle: true,
- duration:speed,
- autoPlay: false
- }).data('slideshow');
- var slideImages = $('.slideImages > .slides').slideshow({
- transition: 'push(left, false, ease)',
- autoStyle: true,
- duration: speed,
- autoPlay: false
- }).data('slideshow');
- var slideHeadlines = $('.slideHeadlines > .slides').slideshow({
- transition: 'push(right, false, ease)',
- autoStyle: true,
- duration: speed,
- autoPlay: false
- }).data('slideshow');
- function showNext() {
- slideImages.show( 'next' );
- slideHeadlines.show( 'next' );
- slideCaptions.show( 'next');
- };
- $( '.sliderNext' ).click(function(){ // Next control
- clearInterval(slidesInterval);
- slideImages.show( 'next' );
- slideCaptions.show( 'next');
- slideHeadlines.show( 'next', {
- transition:'push(right)'
- } )
- });
- $( '.sliderPrev' ).click(function(){ // Previous control
- clearInterval(slidesInterval);
- slideImages.show( 'previous', {
- transition:'push(right)'
- } );
- slideCaptions.show( 'previous');
- slideHeadlines.show( 'previous', {
- transition:'push(left)'
- } );
- });
- $( '.hero' ).hover( // Pauses the slideshow on hover; resumes on de-hover
- function() {clearInterval(slidesInterval); $( '.sliderNav a').fadeTo(100,1); },
- function() {resetInterval(); $( '.sliderNav a').fadeTo(750, .1); }
- )
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement