Advertisement
Guest User

Untitled

a guest
Apr 30th, 2014
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  $(function() {
  2.  
  3.         filterEffect('#options', '#items');
  4.         filterEffect('#options2', '#items2');
  5.  });
  6.  
  7.  
  8.  function filterEffect(nav, items){
  9.      $(nav+" a").click(function() {
  10.          var type = $(this).attr('rel');    
  11.          if(type !== 'all'){
  12.             $(items+" li."+type).animate({'width' : 150, 'opacity' : 1});
  13.             $(items+" li:not(."+type+")").animate({'width' : 0, 'opacity' : 0});
  14.           }else{
  15.             $(items+" li").animate({'width' : 150, 'opacity' : 1});
  16.           }          
  17.         return false;
  18.     });
  19.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement