»
EnglishFrenchVietnamese

Print - Dirty Popup - JavaScriptBank.com

Full version: jsB@nk » Funny » Dirty Popup
URL: https://www.javascriptbank.com/dirty-popup.html

Dirty Popup © JavaScriptBank.comThis JavaScript is really mean and dirty! Put it into your webpage and the script automatically opens a popup-window. When you try to close this popup-window two more popup-windows appear. Try to close these windows and four new popup-windows appear and so on.No panic! After displaying a certain (adjustable) amount of popup-windows the script stops creating new popups and you may close the popup-windows. Easy installation and configuration.

Full version: jsB@nk » Funny » Dirty Popup
URL: https://www.javascriptbank.com/dirty-popup.html



JavaScript
<SCRIPT>// Dirty Popup// Author: Peter Gehrig // Web Site: http://www.24fun.com //////////////////////////////////////////////////////////////////// CONFIGURATION STARTS HERE//////////////////////////////////////////////////////////////////// the URL of the webpage that will be displayed in the popupwindowvar popupurl="../browser/popup_content.html"// the width of the popup-window (pixels)var popupwidth=180// the height of the popup-window (pixels)var popupheight=120// Configure here how many popups shall appear before the script stops// creating new ones// ATTENTION: a high number might crash the PC of your visitorsvar maximumpopups=8//////////////////////////////////////////////////////////////////// CONFIGURATION ENDS HERE//////////////////////////////////////////////////////////////////// do not edit the code below this linevar countpopups=0var ns6=document.getElementById&&!document.all?1:0 var ie=document.all?1:0function startpopup() {    if (ns6 || ie) {        countpopups=0        var popuptop=Math.floor(400*Math.random())          var popupleft=Math.floor(600*Math.random())        window.open(popupurl, "", "toolbar=no,width="+popupwidth+",height="+popupheight+",top="+popuptop+",left="+popupleft+"");    }}function openpopup() {    if (countpopups<maximumpopups && (ns6 || ie)) {        for (i=0;i<=1;i++) {            var popuptop=Math.floor(400*Math.random())            var popupleft=Math.floor(600*Math.random())        window.open(popupurl, "", "toolbar=no,width="+popupwidth+",height="+popupheight+",top="+popuptop+",left="+popupleft+"");            countpopups++        }    }}window.onload=startpopup</SCRIPT>


HTML
<BODY onUnload="openpopup()"></BODY>