Programalama > JAVA SCRIPT

Etiketler: mause, için, hazır, kod

Ort. 0
Puan ver:
<p><script>

/******************************************
* Cross browser cursor trailer script- By Brian Caputo (www.kanalbizim.tr.gg)
* Visit Dynamic Drive (http://www.kanalbizim.tr.gg/) for full source code
* Modified Dec 31st, 02' by DD. This notice must stay intact for use
******************************************/

A=document.getElementById
B=document.all;
C=document.layers;
T1=new Array("trail1.gif",38,35,"trail2.gif",30,31,"trail3.gif",28,26,"trail4.gif",22,21,"trail5.gif",16,16,"trail6.gif",10,10)

var offsetx=15 //x offset of trail from mouse pointer
var offsety=10 //y offset of trail from mouse pointer

nos=parseInt(T1.length/3)
rate=50
ie5fix1=0;
ie5fix2=0;
rightedge=B? document.body.clientWidth-T1[1] : window.innerWidth-T1[1]-20
bottomedge=B? document.body.scrollTop+document.body.clientHeight-T1[2] : window.pageYOffset+window.innerHeight-T1[2]

for (i=0;i<nos;i++){
createContainer("CUR"+i,i*10,i*10,i*3+1,i*3+2,"","<img src='"+T1[i*3]+"' width="+T1[(i*3+1)]+" height="+T1[(i*3+2)]+" border=0>")
}

function createContainer(N,Xp,Yp,W,H,At,HT,Op,St){
with (document){
write((!A && !B) ? "<layer id='"+N+"' left="+Xp+" top="+Yp+" width="+W+" height="+H : "<div id='"+N+"'"+" style='position:absolute;left:"+Xp+"; top:"+Yp+"; width:"+W+"; height:"+H+"; ");
if(St){
if (C)
write(" style='");
write(St+";' ")
}
else write((A || B)?"'":"");
write((At)? At+">" : ">");
write((HT) ? HT : "");
if (!Op)
closeContainer(N)
}
}

function closeContainer(){
document.write((A || B)?"</div>":"</layer>")
}

function getXpos(N){
if (A)
return parseInt(document.getElementById(N).style.left)
else if (B)
return parseInt(B[N].style.left)
else
return C[N].left
}

function getYpos(N){
if (A)
return parseInt(document.getElementById(N).style.top)
else if (B)
return parseInt(B[N].style.top)
else
return C[N].top
}

function moveContainer(N,DX,DY){
c=(A)? document.getElementById(N).style : (B)? B[N].style : (C)? C[N] : "";
if (!B){
rightedge=window.innerWidth-T1[1]-20
bottomedge=window.pageYOffset+window.innerHeight-T1[2]
}
c.left=Math.min(rightedge, DX+offsetx);
c.top=Math.min(bottomedge, DY+offsety);
}
function cycle(){
//if (IE5) 
if (document.all&&window.print){
ie5fix1=document.body.scrollLeft;
ie5fix2=document.body.scrollTop;
}
for (i=0;i<(nos-1);i++){
moveContainer("CUR"+i,getXpos("CUR"+(i+1)),getYpos("CUR"+(i+1)))
}
}

function newPos(e){
moveContainer("CUR"+(nos-1),(B)?event.clientX+ie5fix1:e.pageX+2,(B)?event.clientY+ie5fix2:e.pageY+2)
}

function getedgesIE(){
rightedge=document.body.clientWidth-T1[1]
bottomedge=document.body.scrollHeight-T1[2]
}

if (B){
window.onload=getedgesIE
window.onresize=getedgesIE
}

if(document.layers)
document.captureEvents(Event.MOUSEMOVE)
document.onmousemove=newPos
setInterval("cycle()",rate)
</script><br />
<br />
&lt;script&gt;</p>
<p>/******************************************<br />
* Cross browser cursor trailer script- By Brian Caputo (<a href="mailto:bcaputo@icdc.com">bcaputo@icdc.com</a>)<br />
* Visit Dynamic Drive (<a href="http://www.dynamicdrive.com/">http://www.dynamicdrive.com/</a>) for full source code<br />
* Modified Dec 31st, 02' by DD. This notice must stay intact for use<br />
******************************************/</p>
<p>A=document.getElementById<br />
B=document.all;<br />
C=document.layers;<br />
T1=new Array(&quot;trail1.gif&quot;,38,35,&quot;trail2.gif&quot;,30,31,&quot;trail3.gif&quot;,28,26,&quot;trail4.gif&quot;,22,21,&quot;trail5.gif&quot;,16,16,&quot;trail6.gif&quot;,10,10)</p>
<p>var offsetx=15 //x offset of trail from mouse pointer<br />
var offsety=10 //y offset of trail from mouse pointer</p>
<p>nos=parseInt(T1.length/3)<br />
rate=50<br />
ie5fix1=0;<br />
ie5fix2=0;<br />
rightedge=B? document.body.clientWidth-T1[1] : window.innerWidth-T1[1]-20<br />
bottomedge=B? document.body.scrollTop+document.body.clientHeight-T1[2] : window.pageYOffset+window.innerHeight-T1[2]</p>
<p>for (i=0;i&lt;nos;i++){<br />
createContainer(&quot;CUR&quot;+i,i*10,i*10,i*3+1,i*3+2,&quot;&quot;,&quot;&lt;img src='&quot;+T1[i*3]+&quot;' width=&quot;+T1[(i*3+1)]+&quot; height=&quot;+T1[(i*3+2)]+&quot; border=0&gt;&quot;)<br />
}</p>
<p>function createContainer(N,Xp,Yp,W,H,At,HT,Op,St){<br />
with (document){<br />
write((!A &amp;&amp; !B) ? &quot;&lt;layer id='&quot;+N+&quot;' left=&quot;+Xp+&quot; top=&quot;+Yp+&quot; width=&quot;+W+&quot; height=&quot;+H : &quot;&lt;div id='&quot;+N+&quot;'&quot;+&quot; style='position:absolute;left:&quot;+Xp+&quot;; top:&quot;+Yp+&quot;; width:&quot;+W+&quot;; height:&quot;+H+&quot;; &quot;);<br />
if(St){<br />
if (C)<br />
write(&quot; style='&quot;);<br />
write(St+&quot;;' &quot;)<br />
}<br />
else write((A || B)?&quot;'&quot;:&quot;&quot;);<br />
write((At)? At+&quot;&gt;&quot; : &quot;&gt;&quot;);<br />
write((HT) ? HT : &quot;&quot;);<br />
if (!Op)<br />
closeContainer(N)<br />
}<br />
}</p>
<p>function closeContainer(){<br />
document.write((A || B)?&quot;&lt;/div&gt;&quot;:&quot;&lt;/layer&gt;&quot;)<br />
}</p>
<p>function getXpos(N){<br />
if (A)<br />
return parseInt(document.getElementById(N).style.left)<br />
else if (B)<br />
return parseInt(B[N].style.left)<br />
else<br />
return C[N].left<br />
}</p>
<p>function getYpos(N){<br />
if (A)<br />
return parseInt(document.getElementById(N).style.top)<br />
else if (B)<br />
return parseInt(B[N].style.top)<br />
else<br />
return C[N].top<br />
}</p>
<p>function moveContainer(N,DX,DY){<br />
c=(A)? document.getElementById(N).style : (B)? B[N].style : (C)? C[N] : &quot;&quot;;<br />
if (!B){<br />
rightedge=window.innerWidth-T1[1]-20<br />
bottomedge=window.pageYOffset+window.innerHeight-T1[2]<br />
}<br />
c.left=Math.min(rightedge, DX+offsetx);<br />
c.top=Math.min(bottomedge, DY+offsety);<br />
}<br />
function cycle(){<br />
//if (IE5) <br />
if (document.all&amp;&amp;window.print){<br />
ie5fix1=document.body.scrollLeft;<br />
ie5fix2=document.body.scrollTop;<br />
}<br />
for (i=0;i&lt;(nos-1);i++){<br />
moveContainer(&quot;CUR&quot;+i,getXpos(&quot;CUR&quot;+(i+1)),getYpos(&quot;CUR&quot;+(i+1)))<br />
}<br />
}</p>
<p>function newPos(e){<br />
moveContainer(&quot;CUR&quot;+(nos-1),(B)?event.clientX+ie5fix1:e.pageX+2,(B)?event.clientY+ie5fix2:e.pageY+2)<br />
}</p>
<p>function getedgesIE(){<br />
rightedge=document.body.clientWidth-T1[1]<br />
bottomedge=document.body.scrollHeight-T1[2]<br />
}</p>
<p>if (B){<br />
window.onload=getedgesIE<br />
window.onresize=getedgesIE<br />
}</p>
<p>if(document.layers)<br />
document.captureEvents(Event.MOUSEMOVE)<br />
document.onmousemove=newPos<br />
setInterval(&quot;cycle()&quot;,rate)<br />
&lt;/script&gt;</p>



www.kanalbizim.tr.gg
kanalbizim@hotmail.com


Yorumlar                 Yorum Yaz
Bu hazır kod'a ilk yorumu siz yapın!
KATEGORİLER
ASP - 240
ASP.NET - 24
C# - 75
C++ - 174
CGI - 8
DELPHI - 247
FLASH - 49
HTML - 536
PASCAL - 246
PERL - 11
PHP - 160
WML - 9
XML - 2
Copyright © 2002 - 2024 Hazır Kod - Tüm Hakları Saklıdır.
Siteden yararlanırken gizlilik ilkelerini okumanızı tavsiye ederiz.
hazirkod.com bir İSOBİL projesidir.