【发布时间】:2011-03-18 00:12:12
【问题描述】:
这是我最终想要达到的目标:
//When the user clicks the liveshow button this happens
$(".liveshow-button").live('click', function() {
if ($(".liveshowDiv2").css('display') == 'none') {
$(".liveshowDiv2").fadeOut(ifadeOutSpeed, function() {
$('#wrapper-div').animate({
height: $('.liveshowDiv1').height() + "px"
},
iresizeSpeed, function() {
$('.liveshowDiv1').fadeIn(ifadeInSpeed, function());
});
});
}
else {
alert('This never gets displayed');
$(".liveshowDiv1").slideUp('fast');
}
});
基本上,当您单击此按钮时,我想在显示和隐藏 liveShowDiv1 之间切换。但是由于页面上的其他内容可以使 liveShowDiv1 隐藏,我不能只制作一个切换功能来做到这一点。我必须以某种方式检查是否正在显示 liveShowDiv1。
不显示时:display = none
当它显示时,样式标签中根本没有显示
如何在 JQuery 中判断此 div 何时显示?
【问题讨论】: