Login   Register  
Icontem

File: lib/main.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Greg Lane  >  GrowShrink.js  >  lib/main.js  >  Download  
File: lib/main.js
Role: Example script
Content type: text/plain
Description: Contains examples of use
Class: GrowShrink.js
Grow or shrink elements inside their parents
Author: By
Last change:
Date: 2012-11-13 22:26
Size: 1,653 bytes
 

Contents

Class file image Download
$(document).ready(function(){
    
$("#bottomright").click(function(e){
   hidekids();   
   $("#colorblock").growshrink(); 
});
$("#shrinktopleft").click(function(e){ 
   $("#colorblock").growshrink({type:"shrink",direction:"topleft"}); 
});

$("#bottomleft").click(function(e){
   hidekids();
   $("#colorblock2").growshrink({
    direction:"bottomleft"                           
   }); 
});
$("#shrinktopright").click(function(e){ 
   $("#colorblock2").growshrink({type:"shrink",direction:"topright"}); 
});

$("#topright").click(function(e){
   hidekids();
   $("#colorblock3").growshrink({
    direction:"topright"                           
   }); 
});
$("#shrinkbottomleft").click(function(e){ 
   $("#colorblock3").growshrink({type:"shrink",direction:"bottomleft"}); 
});

$("#topleft").click(function(e){
   hidekids();
   $("#colorblock4").growshrink({
    direction:"topleft"                           
   }); 
});
$("#shrinkbottomright").click(function(e){ 
   $("#colorblock4").growshrink({type:"shrink",direction:"bottomright"}); 
});

$("#middle").click(function(e){
   hidekids();
   $("#colorblock5").growshrink({
    direction:"middle"                           
   }); 
});
$("#shrinkmiddle").click(function(e){ 
   $("#colorblock5").growshrink({type:"shrink",direction:"middle"}); 
});

function hidekids(){
   $("#wrapperblock").children().width(0);
   $("#wrapperblock").children().height(0);
   $("#wrapperblock").children().css('margin-top',0);
   $("#wrapperblock").children().css('margin-bottom',0);
   $("#wrapperblock").children().css('margin-left',0);
   $("#wrapperblock").children().css('margin-right',0);   
}
    
});