添加SetTimeout并转换到jQuery Show / Hide [英] Adding a SetTimeout and transition to jQuery Show / Hide

查看:95
本文介绍了添加SetTimeout并转换到jQuery Show / Hide的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试添加 SetTimeout 并将动画类型转换为jQuery Show / Hide调用。以下是我目前拥有它的方式,但是我希望在恢复到原始 #bg_dv 之前添加showdiv保持显示的特定时间量。我还想在可能的情况下在效果之间添加动画过渡。

I am trying to add a SetTimeout and animation type transition to jQuery Show / Hide call. Below is how I currently have it but am wanting to add the a specific amount of time the 'show' div remains displayed before it reverts back to the orginal #bg_dv. I also want to add animated transitions between the effects if possible.

   function tilt(){
    $("#area1").click(function(){
        $("#bg_div").hide();
        $("#bg_skew").show(); // I would like to show this Div for about 5 seconds
 // and then have original back. 
       });
    }


推荐答案

$("#bg_div").hide(0).delay(5000).show(0);
$("#bg_skew").show(0).delay(5000).hide(0);

如果您想要动画,可以将调用替换为 hide() show()有适当的东西。例如 fadeIn() fadeOut()

If you want animations, you can replace the calls to hide() and show() with something appropriate. For example fadeIn() and fadeOut().

这篇关于添加SetTimeout并转换到jQuery Show / Hide的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆