首页 网页素材 几行代码给网站右下角添加一个弹窗广告 2018年3月31日 1条评论 几行代码给网站右下角添加一个弹窗广告 内容 相关 几行简单代码实现网页右下角的浮窗广告,可以文字或者图片。 代码如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>几行jquery代码搞定网页右下角向左弹出提示层 - 网页设计之家</title> <style> *{ margin:0; padding:0; list-style:none; text-align:left;} a{font-size:12px; color:#666; text-decoration:none;} .wuioo_ad{ width:260px; height:160px; position:fixed; right:-262px; bottom:10px;} .wuioo_ad .close{ width: 30px; height: 22px; line-height: 22px; display: block; float: right; background: rgba(0,0,0,.3); color: #fff; padding: 2px 3px 2px 8px;} </style> <script src="http://oxx0.com/js/jquery.min.js"></script> <script> $(function (){ $('.wuioo_ad').animate({right:'10px'},1000); $('.wuioo_ad .close').click(function(){ $('.wuioo_ad').hide(); }); }); </script> </head> <body> <div class="wuioo_ad"> <a href="javascript:" class="close">关闭</a> <a href="https://www.oxx0.com/"><img src="https://www.oxx0.com/wuioo_ad/ad_1.jpg" alt="首页广告图片" style="width:100%;height:100%;border:2px solid #fff;border-radius:6px;" /></a> </div> </body> </html> 代码已经修正,有什么不懂的可以问我,我是小洋,吾爱搜资源网分享网页技术 点赞  (2) 打赏 分享 支付宝扫一扫 微信扫一扫 企鹅扫一扫