页面加载后隐藏此类,并在显示20秒后显示 [英] Hide This Class after the page is loaded and show after for 20 seconds
本文介绍了页面加载后隐藏此类,并在显示20秒后显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有这段代码,它可以正常工作,但是我想快速隐藏,所以需要1秒钟,我想把它隐藏起来不到1秒钟,然后在20秒后显示?
I have this code, this is working, but i want to hidden fast so 1 sec is to mouch, i want to hide this less then 1 sec and show after 20 seconds ?
$(function(){
setTimeout(function(){
$(".video-LeAdClick-front").show(function(){
setTimeout(function(){
$(".video-LeAdClick-front").hide()
}, 1000)
})
}, 20000)
})
推荐答案
如果我理解正确,为什么不以display: none
开头:
If I understand correctly, why not initiate with display: none
:
.video-LeAdClick-front { display: none }
,然后在您的ready()
中:
$(document).ready(function () {
setTimeout(function () {
$(".video-LeAdClick-front").show().click(function() {
$(this).hide(1000);
});
}, 20000);
});
或者,使用visibility
:
.video-LeAdClick-front { visibility: hidden }
,然后在您的ready()
中:
$(document).ready(function () {
setTimeout(function () {
$(".video-LeAdClick-front").css({"visibility" : "visible"}).click(function() {
$(this).hide(1000);
});
}, 20000);
});
这篇关于页面加载后隐藏此类,并在显示20秒后显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文