Closed kouennrin closed 9 years ago
Hi again, one note at first: Don't ever use the identifier jsPanel (and jspanel better not as well) as name for one of your variables since jsPanel is the one and only global variable in the jsPanel script.
Ok, now your request:
// assign your panel to a variable
var myPanel = $.jsPanel({
position: "center",
theme: "medium",
// more config if needed ...
callback: function(panel){
// select close control
$(".jsPanel-btn-close", panel)
// remove the default handler from the close control
.off()
// bind a new handler to the close control
.click(function(){ panel.hide() });
}
});
// show the panel again
myPanel.show();
// if you, at one point, want the original close handler back:
$(".jsPanel-btn-close", myPanel)
// remove the current handler from the close control
.off()
// bind original close handler to the close control again
.click(function(){ jsPanel.close(myPanel) });
// the original close method is a method of the global jsPanel object and expects the panel to close/remove as argument
As you said, this issue is resolved. Thank you so much!
How can I hide the panel (not destroy panel) by click the close button ? code like this: