Guest User

Untitled

a guest
Apr 30th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. var el=0;
  2. var fast = false;
  3. var all = $('#slide>ul>li').length;
  4. var speed = 10000;
  5. $('#slide li').show();
  6.  
  7. // Create button
  8. var mylist = $('<ul/>');
  9. for(var i=0; i<all; i++)
  10. $('<li/>').appendTo(mylist);
  11.  
  12. $('#slide>ul').after("<nav/>");
  13. $('#slide>nav').append(mylist);
  14. $('#slide>nav>ul>li').show();
  15.  
  16. function slideShow(sp){
  17. e = $('#slide>ul>li').eq(el);
  18. e.addClass('act');
  19. e.find('img').animate({right:'5%', 'opacity':0.5},sp*0.3).animate({right:'7%', 'opacity':1},sp*0.7).delay(sp);
  20. e.find('div').animate({top:'3%', 'opacity':0.5},sp*0.3).animate({top:'5%', 'opacity':1},sp*0.7).delay(sp);
  21. e.find('a').animate({bottom:'23%', 'opacity':0.5},sp*0.3).animate({bottom:'30%', 'opacity':1},sp*0.7).delay(sp);
  22. }
  23.  
  24. function slideHide(sp){
  25. var e = $('#slide>ul>li');
  26. e.removeClass('act');
  27. e.find('img').stop().clearQueue().animate({opacity:0, left:-600},sp, function(){$(this).attr('style','')});
  28. e.find('div').stop().clearQueue().animate({opacity:0, top:-200},sp, function(){$(this).attr('style','')});
  29. e.find('a').stop().clearQueue().animate({opacity:0, bottom:-10},sp, function(){$(this).attr('style','');});
  30. }
  31.  
  32. function slide(){
  33. slideHide(speed*0.3);
  34. if(all==el){ el = 0;}
  35.  
  36. $('#slide>nav li').css({background: '#fff'});
  37. $('#slide>nav li').eq(el).css({background: '#11A2D7'});
  38.  
  39. slideShow(speed*0.7);
  40.  
  41. el++;
  42. }
  43.  
  44. $('#slide nav li').click(function(){
  45. slideHide(speed/11);
  46. clearInterval(clId);
  47. el=$(this).index();
  48. clId = setInterval(slide,speed);
  49. slide();
  50. });
  51. $('#slide>ul>li>a').mouseover(function(){
  52. clearInterval(clId);
  53. });
  54. $('#slide>ul>li>a').mouseout(function(){
  55. clId = setInterval(slide,speed);
  56. });
  57. slide()
  58. var clId =setInterval(slide,speed);
Advertisement
Add Comment
Please, Sign In to add comment