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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章