码迷,mamicode.com
首页 > Web开发 > 详细

模拟网页启动页

时间:2016-09-10 22:07:54      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>css3</title>
<style type="text/css">
*{
    margin:0;
    padding: 0;
}
ul,li{
    list-style: outside none none;
}
.box{
    width: 600px;
    margin: 0 auto;
}
.first_banner{
    margin: 40px 0;
    width: 100%;
    height: 170px;
    background: #ddd;
    display: none;
    position: relative;
}
.first_banner img{
    width: 100%;
}
.first_banner time{
    position: absolute;
    right: 10px;
    top: 10px;
    font-family: "Microsoft Yahei";
}
</style>
</head>
<body>
<div class="box">
    <input type="hidden" class="first_click" value="按钮" />
    <div class="first_banner">
        <time></time>
        <img src="img/1.jpg" alt="">
    </div>
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">
    $(function(){
        var timer = null;
        var s = 5;
        function myFn(){
            $(time).html(s+"");
            s--;
            if(s<0){
                clearInterval(timer);
                $(.first_banner).hide();
            }
        };
        $(.first_click).one(click,function(){
            $(.first_banner).show();
            myFn();
            timer = setInterval(myFn,1000);
        }).click();
    });
</script>
</body>
</html>

 

模拟网页启动页

标签:

原文地址:http://www.cnblogs.com/vscss/p/5860368.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!