46-jQuery弹窗广告

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>46-jQuery弹窗广告</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            position: fixed;
            right: 0px;
            bottom: 0px;
            display: none;
        }
        .ad{
            /*position: relative;*/
        }
        .ad>span{
            display: inline-block;
            width: 30px;
            height: 30px;
            background: red;
            position: absolute;
            right: 0;
            top: 0;
        }
    </style>
    <script src="js/jquery-1.9.1.min.js"></script>
    <script>
        $(function () {
            //1.监听span的点击事件
            $("span").click(function () {
                $(".ad").remove();
            })
            //2.执行广告动画
            // $(".ad").slideDown(1000,function () {
            //     $(".ad").fadeOut(1000,function () {
            //         $(".ad").fadeIn(1000);
            //     })
            // });
            $(".ad").stop().slideDown(1000).fadeOut(1000).fadeIn(1000);
        });
    </script>
</head>
<body>
<div class="ad">
    <img src="imgs/锦衣之下.jpg" alt="">
    <span></span>
</div>
</body>
</html>
发布了6 篇原创文章 · 获赞 0 · 访问量 89

猜你喜欢

转载自blog.csdn.net/jialan75/article/details/104080204