Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 16th, 2012  |  syntax: None  |  size: 1.10 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Bind / Unbind inside callback
  2. changepicturecallback: function(){
  3.                     $('.sxpp_commentsImage').unbind(toggle);
  4.     oldWidth = $('.pp_pic_holder').width() - 20,
  5.     newWidth = $('.pp_pic_holder').width() + (200),
  6.     newHeight = $('.pp_hoverContainer').height(),
  7.     cImageAlign = newWidth - 20;
  8.  
  9.                 var toggle = function() {
  10.                    if(newWidth == $('.sxpp_comments').width()){
  11.                         $('.sxpp_comments').animate({width: oldWidth});
  12.                             }else{
  13.                         $('.sxpp_comments').animate({width: newWidth});
  14.                     }
  15.                 }
  16.  
  17.             $('.sxpp_comments').width(oldWidth).css('background-color','red');
  18.       $('.sxpp_commentsImage').css({'float':'right','background-color':'green','width':'20px','height':newHeight});    
  19.             $('.sxpp_commentsImage').bind('click',toggle);      
  20.   }
  21.        
  22. $('.sxpp_commentsImage').unbind("click", toggle);
  23.        
  24. $('.sxpp_commentsImage').unbind(toggle);
  25.        
  26. $('.sxpp_commentsImage').bind('click.myEvent', toggle);
  27.        
  28. $('.sxpp_commentsImage').unbind('click.myEvent');