2511人加入学习
(5人评价)
Web前端第四季(jQuery)

制作完成于2018年6月19日 基于jQuery-3.3.1

价格 免费
<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>jQuery广告弹窗</title>
    <script type="text/javascript" src="js/jquery-3.3.1.js"></script>
    <style type="text/css">
        #ad{
            width:300px;
            height:300px;
            background-color:antiquewhite;
            position:fixed;
            bottom:0;
            right:0;
            display:none;
        }
    </style>
    <script type="text/javascript">
        setTimeout(function(){
            // $("#ad").show();//display block none
            $("#ad").show(3000,function(){
                console.log("动画播放完成");
            });//"slow" | "fast" | 3000
        },1000);
        setTimeout(function(){
            $("#ad").hide("hide",function(){
                console.log("广告不见了");
            });
        },5000);
        $(function(){
            $("#closeBtn").click(function(){
                $("#ad").hide();
            });
        });


        // $("xxxxxx").click();
    </script>
</head>
<body>
    <div id="ad">
        <button id="closeBtn">关闭</button>
    </div>
</body>
</html>
<!DOCTYPE html>
<head>
    <meta charset="UTF-8">
    <title>jQuery广告弹窗</title>
    <script type="text/javascript" src="js/jquery-3.3.1.js"></script>
    <style type="text/css">
        #ad{
            width:300px;
            height:300px;
            background-color:antiquewhite;
            position:fixed;
            bottom:0;
            right:0;
            display:none;
        }
    </style>
    <script type="text/javascript">
        // setTimeout(function(){
        //     // $("#ad").show();//display block none
        //     $("#ad").show(3000,function(){
        //         console.log("动画播放完成");
        //     });//"slow" | "fast" | 3000
        // },1000);
        // setTimeout(function(){
        //     $("#ad").hide("hide",function(){
        //         console.log("广告不见了");
        //     });
        // },5000);
        // $(function(){
        //     $("#closeBtn").click(function(){
        //         $("#ad").hide();
        //     });
        // });

        // $("xxxxxx").click();

        setTimeout(function(){
            $("#ad").toggle("slow");
        },1000);
        $(function(){
            $("#closeBtn").click(function(){
                $("#ad").toggle("slow");
            });
        });
    </script>
</head>
<body>
    <div id="ad">
        <button id="closeBtn">关闭</button>
    </div>
</body>
</html>

显示和隐藏( 属于effect里面的basic )
show()    //相当于 display:block
第一个参数slow fast 毫秒数(速度)
第二个参数是回调函数
hide()
第一个参数是速度
第二个参数是回调函数
Toggle
如果是显示的就隐藏
如果是隐藏的就显示
滑动显示和隐藏
slideDown
slideUp
参数跟上面的一样
其他显示和隐藏效果
fadeIn
fadeOut

[展开全文]

show(里面可添加函数 slow) 动画特效 

[展开全文]

授课教师

SiKi学院老师

课程特色

下载资料(1)
视频(20)

学员动态

a147258369 加入学习
兢兢叶叶 加入学习
brightLucky 开始学习 资料.zip
苏吉丽 加入学习
user2316312 加入学习