我有这些代码应该会错误地处理两个函数并为它们触发事件。然而,由于某种原因,该事件似乎没有触发。他们按预期登录到控制台,但该事件永远不会被触发。
//Show backstage event
(function( $, oldRem ){
backstage.show = function(){
console.log("yup, I'm the right one");
var resp = oldRem.apply( this, arguments );
$("#backstageArea").trigger("showBackstage");
return(resp);
};
})( jQuery, backstage.show );
//Hide backstage event
(function( $, oldRem ){
backstage.hide = function(){
console.log("And so am I.");
var resp = oldRem.apply( this, arguments );
if(anim && config.chkAnimate) {setTimeout( 'jQuery("#backstageArea").trigger("hideBackstage")', config.animDuration);}
else {$("#backstageArea").trigger("hideBackstage");}
return(resp);
};
})( jQuery, backstage.hide );
//Resize never logs its console message.
jQuery.bind("hideBackstage", function(){topbar.resize();});
jQuery.bind("showBackstage", function(){topbar.resize();});