溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

HTML怎么實現(xiàn)一天彈一次彈窗廣告

發(fā)布時間:2022-03-25 11:19:40 來源:億速云 閱讀:513 作者:iii 欄目:web開發(fā)

這篇文章主要介紹“HTML怎么實現(xiàn)一天彈一次彈窗廣告”的相關(guān)知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“HTML怎么實現(xiàn)一天彈一次彈窗廣告”文章能幫助大家解決問題。

<!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" />

         <meta name="description" content="">

         <meta name="keywords" content="">

         <title>彈窗廣告一天彈一次</title>

<meta name="keywords" content="" />

<meta name="description" content="彈窗廣告一天彈一次" />

         <style type="text/css">

                   *{

                            margin:0;

                            padding:0;

                   }

                  

                   .alert_windows{

                            display:none;

                            position:absolute;

                            z-index:10;

                            width:400px;

                            height:300px;

                            background:#566F93;

                   }

                  

                   .alert_windows span{

                            float:right;

                            width:30px;

                            height:30px;

                            text-align:center;

                            font:15px/30px Microsoft Yahei;

                            cursor:pointer;

                            color:#333;

                            background:lightblue;

                   }

                  

                   .alert_windows span:hover{

                            color:#EEE;

                            background:red;

                   }

         </style>

         <script type="text/javascript" src="js/jquery.min.js"></script>

         <script type="text/javascript" src="js/jquery.cookie.js"></script>

         <script type="text/javascript">

                   $(function(){

                            if($.cookie("isClose") != 'yes'){

                                     var winWid = $(window).width()/2 - $('.alert_windows').width()/2;

                                     var winHig = $(window).height()/2 - $('.alert_windows').height()/2;

                                     $(".alert_windows").css({"left":winWid,"top":-winHig*2});  //自上而下

                                     $(".alert_windows").show();

                                     $(".alert_windows").animate({"left":winWid,"top":winHig},1000);

                                     $(".alert_windows span").click(function(){

                                               $(this).parent().fadeOut(500);

                                               $.cookie("isClose",'yes',{ expires:1/8640});     //測試十秒

                                               //$.cookie("isClose",'yes',{ expires:1});            一天

                                     });

                            }

                   });

         </script>

</head>

 

<body>

        

         <div style="font-size:24px;width:360px;margin:40px auto;">提示:一天彈一次,關(guān)閉了就沒了</div>

        

         <div class="alert_windows">

                   <span>X</span>

         </div>

</body>

</html>

關(guān)于“HTML怎么實現(xiàn)一天彈一次彈窗廣告”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識,可以關(guān)注億速云行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI