Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($){
- //Attach this new method to jQuery
- $.fn.extend({
- showIndex: function(index){
- var i = 0;
- $(this).children().each(function(){
- if(i == index){
- $(this).css("zIndex", "100");
- $(this).animate({left:'+=500'},1000);
- }else{
- $(this).css("zIndex", "0");
- $(this).css("left", "-500px");
- }
- i++;
- });
- },
- iterate: function(el) {
- if( $(this).prop("index") < $(this).prop("maxIndex") ){
- $(this).prop("index", $(this).prop("index") + 1);
- }else{
- $(this).prop("index", 0)
- }
- $(this).showIndex($(this).prop("index"));
- setTimeout("$('#"+el+"').iterate('" + el + "')", 2000);
- },
- //This is where you write your plugin's name
- initRot: function() {
- //Iterate over the current set of matched elements
- this.each(function() {
- var i = 0;
- $(this).children().each(function(){
- if( i == 0){
- $(this).css("zIndex", "100");
- }else{
- $(this).css("zIndex", "0");
- }
- $(this).css({position:"absolute", left:"-500px"});
- });
- //code to be inserted heretttttt
- $(this).prop("maxIndex", $(this).children().size())
- $(this).prop("index", 0)
- $(this).iterate($(this).prop("id"));
- });
- return this;
- }
- });
- })($);
- //-----------------flying frame
- /*
- <div id='frame'>
- <div id='date'></div>
- <div id='title'></div>
- <div id='description'></div>
- <div id='links'>INFORMATION</div>
- </div>
- */
- (function($){
- $.fn.extend({
- showDate:function(){
- $(this).children("#date").animate({left:'+=500', duration:'slow',easing:'easOutBounce'},1000,"", this.showTitle);
- },
- showTitle:function(){
- $(this).children("#title").animate({left:'+=500', duration:'slow',easing:'easOutBounce'},1000,"", this.description);
- },
- showDescription:function(){
- $(this).children("#description").animate({left:'+=500', duration:'slow',easing:'easOutBounce'},1000);
- },
- fly: function(){
- //move all elements off to left
- $(this).children().each(function(){
- $(this).css("left","-500px");
- });
- //move each element in turn
- this.showDate();
- },
- //This is where you write your plugin's name
- flyingframe: function() {
- //Iterate over the current set of matched elements
- this.each(function() {
- });
- $(this).css("position", "relative");
- return this;
- }
- });
- })($);
Add Comment
Please, Sign In to add comment