这样:
<script>
jQuery(document).ready(function($) {
$('.theme-login').click(function(){
$('.theme-popover-mask').fadeIn(100);
$('.theme-popover').slideDown(200);
setTimeout(function() {
console.log('22222222222');
$('.theme-popover-mask').fadeOut(100);
$('.theme-popover').slideUp(200);
}, 1000);
})
$('.theme-poptit .close').click(function(){
$('.theme-popover-mask').fadeOut(100);
$('.theme-popover').slideUp(200);
})
})
</script>
利用setTimeout(),setTimeout()方法用于在指定的毫秒数后调用函数或计算表达式。
语法:
setTimeout(code,millisec)
提示和注释:
setTimeout() 只执行 code 一次。如果要多次调用,请使用 setInterval() 或者让 code 自身再次调用 setTimeout()。
你好,非常感谢你的回答,但是,要是在这个弹出层里加 该怎么加呢?
追答譬如加什么?加文字的话直接layer.innerHTML=xxx
如果加标签的话创建标签appendChild添加进去
啊~ 文字加上了,呵呵,谢谢你,太感谢了,但是就js里写的这些样式如果不满足我想要写的,比如我想加border,padding之类的,该怎么办呢?
追答var style=