<!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> <script type="text/javascript" src="jquery-1.8.3.js"></script> <!--官网下载jquery-1.8.3.js--> <script type="text/javascript"> $(document).ready(function(){ $("#open").click(function(){ $("#idbox").slideDown(); }); //网页加载后,延时5秒弹窗 // setTimeout(function(){ // $("#idbox").slideDown(); // },5000) $("#close").click(function(){ $("#idbox").slideUp(); }); }); </script> </head> <style type="text/css"> *{ margin:0px; padding:0px;} #idbox { 300px; height:200px; border:1px solid #000; position:absolute; bottom:0px; right:10px; display:none;} #idbox a { position:absolute; top:8px; right:8px; font-size:12px; text-decoration:none;} #idbox h2 { font-size:24px; text-align:center; line-height:200px; font-family:"微软雅黑";} </style> <body> <a href="javaScript:void(0)" id="open">点击弹出右下角广告</a> <div id="idbox"> <a href="javaScript:void(0)" id="close">关闭</a> <h2>jQuery实现右下角弹出广告</h2> </div> </body> </html>