JQ实现广告的定时弹出与关闭

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="UTF-8">
 5         <title>广告定时弹出与关闭</title>
 6         <script type="text/javascript" src="../js/jquery-1.11.0.js"></script>
 7         
 8         <script>
 9             function showAD(){
10                 $("#img1").slideDown(3000);
11                 setTimeout("hideAD()",6000);
12             }
13             
14             function hideAD(){
15                 $("#img1").slideUp(3000);
16             }
17             
18             $(function(){
19                 setTimeout("showAD()",3000);
20             });
21         </script>
22     </head>
23     <body>
24         <img src="../img/1.jpg" width="100%" id="img1" style="display: none;"/>
25     </body>
26 </html>

 

posted @ 2020-04-09 13:31  yxfyg  阅读(380)  评论(0)    收藏  举报