01 | <!--MUDAR A IMAGEM......--> |
02 |
03 | <!--UMA ETAPA PARA INSTALAR A IMAGEM SENDO PERSEGUIDA |
04 |
05 | 1. Copie o código no início de seu documneto original do HTML |
06 |
07 | <!-- ETAPA UMA: Cole este código no início de seu documneto original do HTML --><HEAD> |
08 |
09 | <SCRIPT LANGUAGE="JavaScript"> |
10 | <!-- Original: Kien Caoxuan (kcaoxuan@caoxuan.com) --> |
11 | <!-- Web Site: http://www.caoxuan.com/ --> |
12 |
13 | <!-- This script and many more are available free online at --> |
14 | <!-- The JavaScript Source!! http://javascript.internet.com --> |
15 |
16 | <!-- Início |
17 | N = (navigator.appName.indexOf("Netscape") != -1); |
18 | M = (navigator.appName.indexOf("Microsoft") != -1); |
19 | Vis = new Array(); |
20 | Vis[0] = (M) ? "hidden":"hide"; |
21 | Vis[1] = (M) ? "visible":"show"; |
22 | function GetDiv(divId, divY, divX, divW, divH, bCol, visb, zInd) { |
23 | bkCol = (bCol != "")?((N)?" bgColor = "+bCol:";background:"+bCol):""; |
24 | DivTyp = (M) ? "<DIV" : "<LAYER"; |
25 | if(M) { |
26 | Styl = " ID="+divId+" style = 'position:absolute; top:"+divY+"; left:"+divX+"; width:"+divW+"; height:"+divH+bkCol+"; visibility:"+Vis[visb]+"; z-index:"+zInd+"'>"; |
27 | } |
28 | if(N) { |
29 | Styl = " ID = "+divId+" top = "+divY+" left = "+divX+" width = "+divW+" height = "+divH+bkCol+" visibility = "+Vis[visb]+" z-index = "+zInd+">"; |
30 | } |
31 | document.writeln(DivTyp+Styl); |
32 | } |
33 | function EndDiv() { |
34 | (M)? document.writeln("</DIV>"): document.writeln("</LAYER>"); |
35 | } |
36 | GetDiv('Obj', 300, 300, 20, 20, '', 1, 0); |
37 | document.write("<img src=ceuEstrelado.jpg width=150 height=150>"); |
38 | EndDiv(); |
39 | if(document.layers) document.captureEvents(Event.MOUSEMOVE); |
40 | document.onmousemove = newPos; |
41 | function newPos(e) { |
42 | X = (navigator.appName.indexOf("Microsoft") != -1)?event.clientX:e.pageX; |
43 | Y = (navigator.appName.indexOf("Microsoft") != -1)?event.clientY:e.pageY; |
44 | Xo = parseInt((M)?document.all.Obj.style.left:document.Obj.left); |
45 | Yo = parseInt((M)?document.all.Obj.style.top:document.Obj.top); |
46 | if(Math.abs(X - Xo) < 50 && Math.abs(Y - Yo) < 50) { |
47 | if(M) { |
48 | document.all.Obj.style.left = Math.floor(Math.random() * 400); |
49 | document.all.Obj.style.top = 100 + Math.floor(Math.random() * 300); |
50 | } |
51 | if(N) { |
52 | document.Obj.left = Math.floor(Math.random() * 700); |
53 | document.Obj.top = Math.floor(Math.random() * 500); |
54 | } |
55 | } |
56 | } |
57 | // Fim--> |
58 | </script> |
59 |
60 | <p><center> |
61 | </center> |
Comentários