Tout le monde a vu des publicités malveillantes dans une certaine mesure, et vous la fermez et vous revenez! Pourquoi, JS vous dira
Html
<body> <h3> La boîte contextuelle non clos, le xiaoqiang des morts! </h3> <div id = "Middlebox"> <a href = "javascript:;" id = "closebtn"> <img src = "images / close_icon.png"> </a> <ul> <li> <a href = "/"> <img src = "images / icon_tel.gif"> <span> appelez </ span> </a> </li> <li> <a href = "/"> </ img src = "Images / icon_chat.gif"> <span> Laissez un message rapide </span> </a> </li> </div> </body>
CSS
* {margin: 0; rembourrage: 0; Style de liste: aucun; Aperçu: aucun; Dimensionnement en boîte: Border-Box; text-décoration: aucun;} a {-webkit-touch-calhout: aucun; Text-Decoration: Aucun}: focus {Outline: 0} Body {Font-Family: Helvetica, Stheiti, "Microsoft Yahei", Sans-Serif; Couleur: # 595757; Color d'arrière-plan: #FFF; Aperçu: 0; Overflow-X: Hidden; -Webkit-Tap-Highlight-Color: rgba (0,0,0,0);} img {border: non;}. whitecolor {couleur: #ffff; Text-Align: Center;}. Flex_parent {affichage: -webkit-box; Affichage: -moz-box; Affichage: -ms-flexbox; Affichage: -webkit-flex; Affichage: flex;}. flex_child {-webkit-box-flex: 1; -moz-box-flex: 1; -Webkit-flex: 1; -ms-flex: 1; flex: 1;} / * middle_box * / body {position: relative; Background-Color: # 272822;} # MiddleBox {largeur: 260px; hauteur: 248px; marge: 0 auto; Background-Image: url (../ images / irfa_dog.jpg); République de fond: sans répétition; taille de fond: 100% 100%; Border-Radius: 10px; / * Centre vertical horizontal * / position: fixe; Gauche: 50%; en haut: 50%; marge: -124px; -Webkit-transform: tradlatex (-50%); -moz-transform: tradlatex (-50%); -o-transform: tradlatex (-50%); -ms-transform: tradlatex (-50%); Transform: Translatex (-50%); z-index: 100;}. close_btn {affichage: bloc; débordement: caché; Position: absolue; en haut: -10px; droit: -10px;}. will_close {width: 32px;} # middlebox a {overflow: Hidden;} # middlebox a img, # middlebox a span, # middlebox ul li {float: gauche;} # middlebox a span {font-size: 16px; couleur: #ffff;} # middlebox ul {overflow: Hidden;} # middlebox ul li {width: 130px;} # middlebox ul li a {line-height: 50px; Affichage: bloc; padding-left: 5px;} # middlebox ul li a img {width: 30px; marge-droite: 2px; marge: 8px; margin-left: 5px;}. btn_tel {background-Color: # f92665; Border-Bottom-Left-Radius: 10px;}. BTN_CHAT {Background-Color: # 1EA362; Border-Bottom-droite-Radius: 10px;}. Parent_Btn {position: Absolute; à gauche: 0; en bas: 0;}Js
/ ** * Créé par l'administrateur sur 2016/7/19. notre this.div = document.getElementById ("MiddleBox"); this.btn.onclick = this.displayNone; }, displayBlock: function () {adv.div.style.display = "block"; }, displayNone: function () {adv.div.style.display = "Aucun"; timer = setTimeout (function () {adv.displayBlock ();}, 3000); }}; window.onload = function () {adv.init ();};Ce qui précède est tout le contenu de cet article. J'espère que cela sera utile à l'apprentissage de tous et j'espère que tout le monde soutiendra davantage Wulin.com.