
Untitled
By: a guest on
Jun 16th, 2012 | syntax:
None | size: 1.10 KB | hits: 18 | expires: Never
Bind / Unbind inside callback
changepicturecallback: function(){
$('.sxpp_commentsImage').unbind(toggle);
oldWidth = $('.pp_pic_holder').width() - 20,
newWidth = $('.pp_pic_holder').width() + (200),
newHeight = $('.pp_hoverContainer').height(),
cImageAlign = newWidth - 20;
var toggle = function() {
if(newWidth == $('.sxpp_comments').width()){
$('.sxpp_comments').animate({width: oldWidth});
}else{
$('.sxpp_comments').animate({width: newWidth});
}
}
$('.sxpp_comments').width(oldWidth).css('background-color','red');
$('.sxpp_commentsImage').css({'float':'right','background-color':'green','width':'20px','height':newHeight});
$('.sxpp_commentsImage').bind('click',toggle);
}
$('.sxpp_commentsImage').unbind("click", toggle);
$('.sxpp_commentsImage').unbind(toggle);
$('.sxpp_commentsImage').bind('click.myEvent', toggle);
$('.sxpp_commentsImage').unbind('click.myEvent');