»
EnglishFrenchVietnamese

Print - Catch me if you really can - JavaScriptBank.com

Full version: jsB@nk » Funny » Catch me if you really can
URL: https://www.javascriptbank.com/catch-me-if-you-really-can.html

Catch me if you really can © JavaScriptBank.comThis script will make the image alway moves with mouse cursor at the same time but they can't touch together.

Full version: jsB@nk » Funny » Catch me if you really can
URL: https://www.javascriptbank.com/catch-me-if-you-really-can.html



JavaScript
<SCRIPT>// Catch me if you really canvar x=0var y=0var xpos=0var ypos=0var xcentervar ycentervar windowheightvar windowheightfunction cursortracker(e){x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientXy = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY}function inite() {if (document.layers) {windowheight=window.innerHeightwindowwidth=window.innerWidthdocument.captureEvents(Event.MOUSEMOVE);document.onmousemove=cursortracker;}if (document.all) {windowheight=document.body.clientHeight    windowwidth=document.body.clientWidthdocument.onmousemove=cursortracker;}xcenter=Math.round(windowwidth/2)ycenter=Math.round(windowheight/2)changeposition()}function changeposition() {if (x>=(xcenter-60) && x<=xcenter) {xpos=0}else if (x<=(xcenter+60) && x>=xcenter) {xpos=windowwidth-60}else {xpos=-1*(x-xcenter)+xcenter}if (y>=(ycenter-50) && y<=ycenter) {ypos=ycenter+50}else if (y<=(ycenter+50) && y>=ycenter) {ypos=ycenter-50}else {ypos=-1*(y-ycenter)+ycenter}if (document.all) {    document.all.catchmeimg.style.posLeft=xposdocument.all.catchmeimg.style.posTop=ypos}if (document.layers) {    document.catchmeimg.left=xposdocument.catchmeimg.top=ypos}var timer=setTimeout("changeposition()",50)}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<BODY onload=inite()><DIV id=catchmeimg style="LEFT: -200px; POSITION: absolute; TOP: -1000px">  <IMG src="../image/logojs.gif" width="30" height="77"> </DIV></BODY><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->