Hundred-percent pop-up window

Source: Internet
Author: User
Tags reset tagname window
Pop-up window

Advantages: compatibility is good, and I think there should be no interception tools to intercept
Advantages: Very Short Code
Disadvantage: the page must be clicked before it pops up

Demo

Run Code Box

<pead><style> #link001 img {border-style:none;} </style><script>function cancelopennew () {if (!window.event) {settimeout (cancelopennewa,1000); return;} var obj=window.event.srcelement; if (!obj) return; if (!obj.tagname) return; if (String (obj.tagname). Match (/input|select|option|textarea/i)) return; SetTimeout (cancelopennewa,1000);} function Cancelopennewa () {Document.body.appendChild (document.getElementById (' MainDiv001 '));} </script></pead><body><a href= "http://www.blueidea.com" target= "_blank" id= "link001" Color:black; Text-decoration:none; Cursor:default; Display:block "hidefocus=" true "><div id=" MainDiv001 "><!--this are a comment-->this is a test. <br>i try to put something here.<br><input/><br><div > a div.</div><ol&gt ; <li> and this</li> <li> is a lIst</li></ol><form> this is a form. <input/><input type= "checkbox"/> <input type= "Radio" name= "Hutia" value= "1"/><input type= "Radio" "Name=" Hutia "value=" 0 "/> <select><option>this is a select</option> <option>this is a Select </option> </select> <textarea> and is a textarea</textarea> <input type= button "Value=" Button "/> <input type=" Submit "value=" submit "/> <input" reset "type=" reset "value= iframe src= "http://www.blueidea.com" ></iframe><!--This is another comment--></div></a> </body>

[Ctrl + A ALL SELECT hint: You can modify some of the code, and then run]

Description

1. To ensure that the IMG on the page does not appear ugly border

<style>
#link001 img {border-style:none;}
</style>

2. Ensure window only pops up once

<script>
function Cancelopennew () {
if (!window.event) {settimeout (cancelopennewa,1000); return;}
var obj=window.event.srcelement;
if (!obj) return;
if (!obj.tagname) return;
if (String (obj.tagname). Match (/input|select|option|textarea/i)) return;
SetTimeout (cancelopennewa,1000);
}

function Cancelopennewa () {Document.body.appendChild (document.getElementById (' MainDiv001 '));}
</script>

3. This structure is the root of the window----in fact, just a target= "_blank" link, interception program if even this will stop, I have nothing to say

<body>
<a href= "http://www.blueidea.com" target= "_blank" id= "link001" style=; Text-decoration:none; Cursor:default; Display:block "hidefocus=" True >
<div id= "MainDiv001" >

4. Never forget to add at the end of the page:

</div>
</a>
</body>



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.