Advertisement
keenanerwin

Slideshow

Jun 6th, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.64 KB | None | 0 0
  1. // jQuery
  2.  
  3. var imageOne = function(){
  4.            
  5.             $("#img1").delay(5000).fadeTo(500,0,imageTwo);
  6.             $("#spotSelector").delay(5000).animate({left:'990px'},1000); // The moving green box thing
  7.             $("#spotOne").delay(5000).animate({borderWidth:"0px", left:"964px", top:"885px"},1).fadeTo(500,.3)};
  8.  
  9.  
  10. var imageTwo = function(){
  11.            
  12.             $("#img1").css('z-index', 0);
  13.             $("#img2").css('z-index', 1).fadeTo(500,1).delay(5000).fadeTo(500,0,imageThree);
  14.             $("#spotSelector").delay(5000).animate({left:'1024px'},1000);
  15.             $("#spotTwo").fadeTo(500,1).animate({borderWidth:"3px", left:"995px", top:"882px"},1).delay(5000).animate({borderWidth:"0px", left:"998px", top:"885px"},1).fadeTo(500,.3)};
  16.  
  17.  
  18. var imageThree = function(){
  19.            
  20.             $("#img2").css('z-index', 0);
  21.             $("#img3").css('z-index', 1).fadeTo(500,1).delay(5000).fadeTo(500,0,imageFour);
  22.             $("#spotSelector").delay(5000).animate({left:'1058px'},1000);
  23.             $("#spotThree").fadeTo(500,1).animate({borderWidth:"3px", left:"1029px", top:"882px"},1).delay(5000).animate({borderWidth:"0px", left:"1032px", top:"885px"},1).fadeTo(500,.3)};
  24.  
  25.  
  26. var imageFour = function(){
  27.            
  28.             $("#img3").css('z-index', 0);
  29.             $("#img4").css('z-index', 1).fadeTo(500,1).delay(5000).fadeTo(500,0,imageFive);
  30.             $("#spotSelector").delay(5000).animate({left:'1092px'},1000);
  31.             $("#spotFour").fadeTo(500,1).animate({borderWidth:"3px", left:"1063px", top:"882px"},1).delay(5000).animate({borderWidth:"0px", left:"1066px", top:"885px"},1).fadeTo(500,.3)};
  32.  
  33.  
  34. var imageFive = function(){
  35.            
  36.             $("#img4").css('z-index', 0);
  37.             $("#img5").css('z-index', 1).fadeTo(500,1).delay(5000).fadeTo(500,0,repeat);
  38.             $("#spotSelector").delay(5000).animate({left:'956px'},1000);
  39.             $("#spotFive").fadeTo(500,1).animate({borderWidth:"3px", left:"1097px", top:"882px"},1).delay(5000).animate({borderWidth:"0px", left:"1100px", top:"885px"},1).fadeTo(500,.3)};
  40.  
  41.  
  42. var repeat = function(){
  43.            
  44.             $("#img5").css('z-index', 0);
  45.             $("#img1").css('z-index', 1).fadeTo(500,1,imageOne);
  46.             $("#spotOne").fadeTo(350,1).animate({borderWidth:"3px", left:"961px", top:"882px"},1)};
  47.  
  48.  
  49. var slideshow = function(){
  50.    
  51.             imageOne().
  52.             imageTwo().
  53.             imageThree().
  54.             imageFour().
  55.             imageFive().
  56.             repeat()};
  57.  
  58.  
  59. $(document).ready(function(){  
  60.  
  61.     slideshow()
  62.  
  63.  
  64.     $("#spotOne").click(function(){
  65.         $(slideshow).clearQueue()});
  66.  
  67. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement