jQuery定时函数(jQuery timed function)
我不熟悉jQuery,并试图设置一个条件语句来隐藏页脚,当面板使用jQuery滑到页面上时。
我试图检测面板是否外出,如果是这样,则隐藏页脚,如果面板是否显示页脚。 但是,当用户在面板之间切换时,我试图避免让页脚闪烁。
I'm not to familiar with jQuery and have tried to set up a conditional statement for hiding a footer when a panel is slid out onto the page using jQuery.
I'm trying to detect whether the panel is out, if so hide the footer, and if the panel is in to show the footer. However I'm trying to avoid having the footer flash on and off as the user switches between panels.
最满意答案
尝试这个...
$(function(){ if ((objSlidePanel).hasClass('out')) { $('#foot').delay(500).fadeIn("slow"); } else{ $('#foot').delay(500).fadeOut("slow"); } }); $(settings.objSlideTrigger).bind('click' , function() { if ( $('.panel').hasClass('out') ) slidePanelIn(); settings.objSlidePanel = "#"+ $(this).data('content') +""; //If the panel isn't out if(!$(settings.objSlidePanel).hasClass('out')) { slidePanelOut(); $('#foot').delay(500).fadeOut("slow"); } else if($(settings.objSlidePanel).hasClass('out')) { slidePanelIn(); $('#foot').delay(500).fadeIn("slow"); } });更多推荐
发布评论