Guest User

Untitled

a guest
Jun 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($){
  2.     //Attach this new method to jQuery
  3.     $.fn.extend({
  4.        
  5.         showIndex: function(index){
  6.             var i = 0;
  7.             $(this).children().each(function(){
  8.                 if(i == index){
  9.                     $(this).css("zIndex", "100");
  10.                     $(this).animate({left:'+=500'},1000);
  11.                 }else{
  12.                     $(this).css("zIndex", "0");
  13.                     $(this).css("left", "-500px");
  14.                 }
  15.                 i++;
  16.             });
  17.         },
  18.        
  19.         iterate: function(el) {
  20.  
  21.             if( $(this).prop("index") < $(this).prop("maxIndex") ){
  22.                 $(this).prop("index", $(this).prop("index") + 1);
  23.             }else{
  24.                 $(this).prop("index", 0)
  25.             }
  26.             $(this).showIndex($(this).prop("index"));
  27.             setTimeout("$('#"+el+"').iterate('" + el + "')", 2000);
  28.         },
  29.        
  30.         //This is where you write your plugin's name
  31.         initRot: function() {
  32.             //Iterate over the current set of matched elements
  33.             this.each(function() {
  34.                 var i = 0;
  35.                 $(this).children().each(function(){
  36.                     if( i == 0){
  37.                         $(this).css("zIndex", "100");
  38.                     }else{
  39.                         $(this).css("zIndex", "0");
  40.                     }
  41.                     $(this).css({position:"absolute", left:"-500px"});
  42.                 });
  43.                 //code to be inserted heretttttt
  44.                 $(this).prop("maxIndex", $(this).children().size())
  45.                 $(this).prop("index", 0)
  46.                 $(this).iterate($(this).prop("id"));
  47.                
  48.                
  49.             });
  50.            
  51.             return this;
  52.         }
  53.     });
  54. })($);
  55.  
  56.  
  57.  
  58. //-----------------flying frame
  59. /*
  60. <div id='frame'>
  61.     <div id='date'></div>
  62.     <div id='title'></div>
  63.     <div id='description'></div>
  64.     <div id='links'>INFORMATION</div>
  65. </div>
  66. */
  67. (function($){
  68.  
  69.     $.fn.extend({
  70.        
  71.         showDate:function(){
  72.             $(this).children("#date").animate({left:'+=500', duration:'slow',easing:'easOutBounce'},1000,"", this.showTitle);
  73.         },
  74.         showTitle:function(){
  75.             $(this).children("#title").animate({left:'+=500', duration:'slow',easing:'easOutBounce'},1000,"", this.description);
  76.         },
  77.         showDescription:function(){
  78.             $(this).children("#description").animate({left:'+=500', duration:'slow',easing:'easOutBounce'},1000);
  79.         },
  80.         fly: function(){
  81.             //move all elements off to left
  82.             $(this).children().each(function(){
  83.                 $(this).css("left","-500px");
  84.             });
  85.            
  86.             //move each element in turn
  87.             this.showDate();
  88.         },
  89.        
  90.        
  91.         //This is where you write your plugin's name
  92.         flyingframe: function() {
  93.             //Iterate over the current set of matched elements
  94.             this.each(function() {
  95.                
  96.             });
  97.             $(this).css("position", "relative");
  98.             return this;
  99.         }
  100.     });
  101. })($);
Add Comment
Please, Sign In to add comment