I'm using a simple jQuery content panel switcher that I am trying to add a close button to. The close button is working but then after using the close button I can't re-open a panel again. The code for the panel switcher plugin is below:
jcps.fader = function(speed, target, panel) {
jcps.show(target, panel);
if (panel == null) {panel = ''};
$('.switcher' + panel).click(function() {
var _contentId = '#' + $(this).attr('id') + '-content';
var _content = $(_contentId).html();
if (speed == 0) {
$(target).html(_content);
}
else {
$(target).fadeToggle(speed, function(){$(this).html(_content);}).fadeToggle(speed);
}
});
};
And here is the call in my HTML page that I have added the click event to:
$(document).ready(function() {
jcps.fader(300, '#switcher-panel');
$(".close").live('click',function(){
$(".content").fadeOut("slow");
});
});
This all works fine for closing the content panel but I am unable to open a panel again after clicking close.
Does this apply/make sense?
edit--
$(document).ready(function() {
jcps.fader(300, '#switcher-panel');
$(".close").live('click',function(){
if (Clicked == true){
//run jquery code to hide
} else {
//run jquery code to show
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.