»
EnglishFrenchVietnamese

Print - Black Hole - JavaScriptBank.com

Full version: jsB@nk » Image » Black Hole
URL: https://www.javascriptbank.com/black-hole.html

Black Hole © JavaScriptBank.comClicking the JavaScript link activates the all powerful Balck Hole and transport you to your destination link. Works in MSIE Only.

Full version: jsB@nk » Image » Black Hole
URL: https://www.javascriptbank.com/black-hole.html



JavaScript
<script><!--//created by Vjekoslav Begovic ([email protected] href;function showBlackHole(){ var obj =document.getElementById("hole").style; obj.position = 'absolute';obj.top = Math.round((document.body.clientHeight -document.imgHole.height)/2); obj.left =Math.round((document.body.clientWidth - document.imgHole.width)/2);obj.visibility = 'visible';}function fitToScreen(){ var obj = document.getElementById("doc").style;obj.position = 'absolute'; obj.top = 0; obj.height =document.body.clientHeight; obj.width = document.body.clientWidth;obj.overflow = 'hidden';}function initImplode(){ if ((!document.all) ||(!document.getElementById)){ document.location.href = href; return; }showBlackHole(); fitToScreen(); var docdiv =document.getElementById("doc").style; x1 = parseInt(docdiv.left); y1 =parseInt(docdiv.top); x2 = x1 + docdiv.width; y2 = y1; x3 = x2; y3 = y1+ docdiv.height; x4 = x1; y4 = y3; imgdiv =document.getElementById("hole").style; a1 = parseInt(imgdiv.left); b1 =parseInt(imgdiv.top); a2 = a1 + document.imgHole.width; b2 = b1; a3 =a2; b3 = b2 + document.imgHole.height; a4 = a1; b4 = b3; oldWidth =parseInt(docdiv.width); oldHeight = parseInt(docdiv.height); blackTimer= null; i = x1 + 1; implode();}function implode(){ var obj = document.getElementById("doc").style; if((parseInt(obj.left) >=a1+Math.ceil(parseInt(document.getElementById('imgHole').height) / 2))|| (parseInt(obj.top) >=b1+Math.ceil(parseInt(document.getElementById('imgHole').width) / 2))){obj.top = b1 +Math.ceil(parseInt(document.getElementById('imgHole').width) / 2);obj.left = a1 +Math.ceil(parseInt(document.getElementById('imgHole').height) / 2);obj.width = 0; obj.height = 0; stop(); return; } obj.left = i; try{obj.width = oldWidth - 2*i; } catch(e){} var j =Math.round(((y1-b1)/(x1-a1))*i); obj.top = j; try{ obj.height =oldHeight - 2*j; } catch(e){} i+=10; blackTimer =window.setTimeout("implode()", 1);}function stop(){ window.clearTimeout(blackTimer);document.location.href = href;}function hyperlink(ref){ href = ref; initImplode();}--></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<div id="hole" style="visibility:hidden; z-index:100;"><imgname="imgHole" src="hole.gif" border="0" alt="" width="100"height="100"></div><div id="doc" style="position:relative; top: 5; left: 5;"><!--All HTML goes here-->Any text between the div tags gets sucked into the black hole. Clicking the link activates the all powerful Balck Hole and transport you to your destination link. Works in MSIE Only.<p>Here&#39;s an example: <a href ="javascript:hyperlink('http://javascriptbank.com')">JavaScripts</a>.<p><ahref="javascript:hyperlink('http://javascriptbank.com')">More JavaScripts.....</a></div><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->