jQuery定时函数(jQuery timed function)

编程入门 行业动态 更新时间:2024-10-27 06:31:13
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"); } });

更多推荐

本文发布于:2023-07-05 14:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1038489.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   jQuery   function   timed

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!