我是靠谱客的博主 风中烧鹅,最近开发中收集的这篇文章主要介绍jQuery—弹窗广告,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

实现弹窗广告出现消失再出现,点击X号广告消失

	// Html部分
 	<div class="ad">
        <img src="leader.png">
        <span></span>
    </div>
    
    // CSS部分
    *{
         margin: 0;
         padding: 0;
     }
     .ad{
         position:fixed;
         right: 0;
         bottom: 0;
         display: none;
     }
     .ad>span{
         display:inline-block;
         background-color: brown;
         margin: 0 auto;
         width: 30px;
         height: 30px;
         position:absolute;
         right: 0;
         top: 0;
     }
	// JS部分
	$(function(){
         // 监听span点击事件
         $('span').click(function(){
             $(".ad").remove()
         })
         // 普通执行广告动画
         // $('.ad').slideDown(1000,function(){       //升起
         //     $('.ad').fadeOut(1000,function(){     //消失
         //         $('.ad').fadeIn(1000);            //出现
         //     })
         // })
         //广告动画链式执行
         $('.ad').slideDown(1000).fadeOut(1000).fadeIn(1000)
    })

最后

以上就是风中烧鹅为你收集整理的jQuery—弹窗广告的全部内容,希望文章能够帮你解决jQuery—弹窗广告所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(85)

评论列表共有 0 条评论

立即
投稿
返回
顶部