Dialog box that cannot be closed by javascript implementation

Source: Internet
Author: User
The bullet box that javascript implementation cannot be closed has seen malicious advertisements on a webpage. Once you close it, it comes out again! Why does JS tell you?

HTML

The pop-up box that cannot be closed!

  • Call
  • Quick message

CSS

* {Margin: 0; padding: 0; list-style: none; outline: none; box-sizing: border-box; text-decoration: none ;} a {-webkit-touch-callout: none; text-decoration: none }:focus {outline: 0} body {font-family: Helvetica, STHeiTi, "Microsoft YaHei ", sans-serif; color: #595757; background-color: # fff; outline: 0; overflow-x: hidden;-webkit-tap-highlight-color: rgba (0, 0, 0, 0);} img {border: none ;}. whiteColor {color: # fff; text-align: center ;}. flex_parent {display:-webkit-box; display:-moz-box; display:-ms-flexbox; display:-webkit-flex; display: 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 {width: 260px; height: 248px; margin: 0 auto; background-image: url (.. /images/irfa_dog.jpg); background-repeat: no-repeat; background-size: 100% 100%; border-radius: 10px;/* horizontal vertical center */position: fixed; left: 50%; top: 50%; margin-top:-124px;-webkit-transform: translateX (-50%);-moz-transform: translateX (-50%);-o-transform: translateX (-50%);-ms-transform: translateX (-50%); transform: translateX (-50%); z-index: 100 ;}. close_btn {display: block; overflow: hidden; position: absolute; top:-10px; right:-10px ;}. will_close {width: 32px;} # middleBox a {overflow: hidden;} # middleBox a img, # middleBox a span, # middleBox ul li {float: left ;} # middleBox a span {font-size: 16px; color: # fff ;}# middleBox ul {overflow: hidden ;}# middleBox ul li {width: 130px ;} # middleBox ul li a {line-height: 50px; display: block; padding-left: 5px ;}# middleBox ul li a img {width: 30px; margin-right: 2px; margin-top: 8px; margin-left: 5px ;}. btn_tel {background-color: # F92665; border-bottom-left-radius: 10px ;}. btn_chat {background-color: #1ea133; border-bottom-right-radius: 10px ;}. parent_btn {position: absolute; left: 0; bottom: 0 ;}

JS

/** * Created by Administrator on 2016/12/5. */var adv={  p:null,  timer:null,  btn:null,  init:function(){    this.btn=document.getElementById("closeBtn");    this.p=document.getElementById("middleBox");    this.btn.onclick=this.displayNone;  },  displayBlock:function(){    adv.p.style.display="block";  },  displayNone:function(){    adv.p.style.display="none";    timer=setTimeout(function(){      adv.displayBlock();    },3000);  }};window.onload=function(){  adv.init();};

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.