DJ_MEKANSIZ SÜPER AKTİF
Mesaj Sayısı : 629 REP GÜCÜ : 9 Kayıt tarihi : 05/09/08
DJ_MEKANSIZ SESSİZCENNET:
| Konu: MAUS EFEKTLERİ KODU Paz Kas. 23, 2008 3:17 pm | |
| Mouseyi takip eden yazı 2 - Kod:
-
<script LANGUAGE="Javascript"> <!-- Delayed Mouse Follow by kurt.grigg@virgin.netmessage='Gezginler.Net'; FonT='Verdana'; ColoR='999999'; SizE=2; //1 ile 7 arası! var amount=5,ypos=-50,xpos=0,Ay=0,Ax=0,By=0,Bx=0,Cy=0,Cx=0,Dy=0,Dx=0,Ey=0,Ex=0; if (document.layers){ for (i = 0; i < amount; i++) {document.write('<layer name=nsl'+i+' top=0 left=0><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></layer>')} window.captureEvents(Event.MOUSEMOVE); function nsmouse(evnt){ xpos=evnt.pageX+20; ypos=evnt.pageY+20; } window.onMouseMove = nsmouse; } else if (document.all){ document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>"); document.write("<div style='position:relative'>"); for (i = 0; i < amount; i++) {document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;width:400px;height:20px"><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></div>')} document.write("</div>"); document.write("</div>"); function iemouse(){ ypos=event.y+20; xpos=event.x+20; } window.document.onmousemove = iemouse; } function makefollow(){ if (document.layers){ document.layers['nsl'+0].top=ay;document.layers['nsl'+0].left=ax; document.layers['nsl'+1].top=by;document.layers['nsl'+1].left=bx; document.layers['nsl'+2].top=cy;document.layers['nsl'+2].left=cx; document.layers['nsl'+3].top=Dy;document.layers['nsl'+3].left=Dx; document.layers['nsl'+4].top=Ey;document.layers['nsl'+4].left=Ex; } else if (document.all){ outer.style.pixelTop=document.body.scrollTop; text[0].style.pixelTop=ay;text[0].style.pixelLeft=ax; text[1].style.pixelTop=by;text[1].style.pixelLeft=bx; text[2].style.pixelTop=cy;text[2].style.pixelLeft=cx; text[3].style.pixelTop=Dy;text[3].style.pixelLeft=Dx; text[4].style.pixelTop=Ey;text[4].style.pixelLeft=Ex; } } function move(){ ey=Ey+=(ypos-Ey)*0.2;ex=Ex+=(xpos-Ex)*0.2; dy=Dy+=(ey-Dy)*0.3;dx=Dx+=(ex-Dx)*0.3; cy=Cy+=(dy-Cy)*0.4;cx=Cx+=(dx-Cx)*0.4; by=By+=(cy-By)*0.5;bx=Bx+=(cx-Bx)*0.5; ay=Ay+=(by-Ay)*0.6;ax=Ax+=(bx-Ax)*0.6; makefollow(); setTimeout('move()',10); } window.onload=move; //--> </script> Resim sürükle - Kod:
-
<div id="pics0" style="position:absolute;top:10px;left:10px;cursor:move"> <img src="kelebek1.gif" name="0"> </div> <div id="pics1" style="position:absolute;top:100px;left:10px;cursor:move"> <img src="kelebek2.gif" name="1"> </div> <script language="Javascript"> <!-- Drag n Drop script - kurt.grigg@virgin.netimgs=new Array("p1.gif","p2.gif","p3.gif","p4.gif","p5.gif") load=new Array() for(i=0; i < imgs.length; i++){ load[i]=new Image(); load[i].src=imgs[i]; } var ns=(document.layers); var ns6=(document.getElementById&&!document.all); var ie=(document.all); var n=imgs.length; var y=null; var x=null; var z=null; var w=null; if (ns||ns6){ window.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP); document.releaseEvents(Event.MOUSEMOVE); } if (ns){window.onmousedown=down;window.onmouseup=up} if (ie||document.getElementById){document.onmousedown=down;document.onmouseup=up} function down(e){ if (ns){ if (document.layers['pics'+e.target.name]){ window.onmousemove=move; z=document.layers['pics'+e.target.name]; y=e.layerY; x=e.layerX; document.layers['pics'+e.target.name].zIndex=n++; } else {return true} w=z.name.charAt(z.name.length-1); } if (ie && window.event.srcElement.parentElement){ if (window.event.srcElement.parentElement.id.indexOf("pics") != -1){ document.onmousemove=move; z=window.event.srcElement.parentElement; y=window.event.offsetY; x=window.event.offsetX; w=window.event.srcElement.parentElement.id.charAt(window.event.srcElement.parentElement.id.length-1); window.event.srcElement.parentElement.style.zIndex=n++; } } if (ns6){ if (e.target.parentNode.id.indexOf("pics") != -1){ document.onmousemove=move; z=e.target.parentNode.style; x=e.clientX - parseInt(z.left); y=e.clientY - parseInt(z.top); w=e.target.parentNode.id.charAt(e.target.parentNode.id.length-1); z.zIndex=n++; } } return false; } function move(e){ if (ns && z){z.left=e.pageX-x;z.top=e.pageY-y;} if (ns6 && z){z.top=parseInt(e.clientY)-y;z.left=parseInt(e.clientX)-x} if (ie && z){z.style.posLeft=window.event.clientX-x;z.style.posTop=window.event.clientY-y} return false; } function up(e){ if (ie||ns6)document.onmousemove=null; if (ns)window.onmousemove=null; z=null; } //--> </script> Güzel bir efekt [code]
[code] Sol tuş efekti [/code] Mouse sol tuşunu tıklayın...
var ver = navigator.appVersion; var dom = document.getElementById ? 1 : 0; var ie5 = (ver.indexOf("MSIE 5") > -1 && dom) ? 1 : 0; var n = (document.layers); var ie = (document.all); var sparksAflyin = 0; var totalSparks = 0; var sparksOn = 1; function initMouseEvents() { document.onmousedown = mouseDown; if (n) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE); } function mouseDown(e) { if (sparksOn) { var mousex = (n) ? e.pageX : event.x+document.body.scrollLeft; var mousey = (n) ? e.pageY : event.y+document.body.scrollTop; if (!sparksAflyin) { for (var k = 0; k <= 9; k++) eval('SHOW("sDiv'+k+'")'); sparksAflyin = 1; totalSparks = 0; for(i = 0;i <= 9; i++) eval('moveTo('+i+',0,'+mousex+','+mousey+')'); } } } function moveTo(i,j, mousex, mousey){ if (j < eval('anim_'+i+'_x.length') ){ var tempx = eval('anim_'+i+'_x[j]+mousex'); var tempy = eval('anim_'+i+'_y[j]+mousey'); if (ie) { if(tempy+30 > (document.body.offsetHeight+document.body.scrollTop)) tempy = document.body.offsetHeight+document.body.scrollTop-30; if(tempx+30 > (document.body.offsetWidth+document.body.scrollLeft)) tempx = document.body.offsetWidth+document.body.scrollLeft-30; eval('document.all.sDiv'+i+'.style.left = tempx;'); eval('document.all.sDiv'+i+'.style.top = tempy;'); } if (n) { eval('document.layers.sDiv'+i+'.left = tempx;'); eval('document.layers.sDiv'+i+'.top = tempy;'); } j++; // timeout: 50 = fireworks speed, larger number = slower speed setTimeout("moveTo("+i+","+j+","+mousex+","+mousey+")",50) } else { eval('HIDE("sDiv'+i+'")'); totalSparks++; } if (totalSparks == 10) { sparksAflyin = 0; totalSparks = 0; } } function SHOW(divName){ if (document.all) eval('document.all.'+divName+'.style.visibility = "visible";'); else if (document.layers) eval('document.layers["'+divName+'"].visibility = "visible";'); } function HIDE(divName){ if (document.all) eval('document.all.'+divName+'.style.visibility = "hidden";'); else if (document.layers) eval('document.layers["'+divName+'"].visibility = "hide";'); } anim_0_x=new Array(20,20,10,0,0,0,0,0,0,0,0,0); anim_0_y=new Array(-20,-40,-60,-80,-60,-40,-20,0,20,40,60,80); anim_1_x=new Array(20,20,17,36,60,78,90,92,93,98,108,120,133,152,181); anim_1_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253); anim_2_x=new Array(20,20,2,3,4,5,6,7,8,9,10,12,13,15,18); anim_2_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253); anim_3_x=new Array(-20,-20,-2,-1,7,10,18,35,60,102,94,94,93,97,108,111,117,127); anim_3_y=new Array(-20,-25,-64,-89,-104,-150,-173,-197,-213,-199,-151,-101,-66,-17,27,87,140,189); anim_4_x=new Array(-20,-20,-10,-39,-30,-69,-64,-138,-154,-200,-181,-209,-191,-207,-203,-213,-202,-221,-211); anim_4_y=new Array(-20,-20,-28,-51,-79,-100,-135,-154,-193,-183,-149,-134,-89,-60,8,51,107,157,201); anim_5_x=new Array(-20,-29,-51,-72,-105,-133,-164,-189,-209,-229,-247,-270,-279,-282,-283,-283,-285,-286,-288); anim_5_y=new Array(-20,-55,-86,-116,-154,-183,-205,-217,-217,-198,-169,-120,-44,-8,40,87,144,190,248); anim_6_x=new Array(-20,-20,-7,14,44,79,143,186,217,226,234,244,250,259,265,274); anim_6_y=new Array(-20,-21,-72,-113,-139,-166,-188,-181,-126,-68,-3,54,134,187,215,257); anim_7_x=new Array(20,20,-3,-9,-13,-27,-33,-44,-54,-66,-77,-95,-107,-136,-150,-160,-164,-168,-171,-172,-172,-176,-175); anim_7_y=new Array(-20,-26,-43,-63,-89,-116,-145,-169,-201,-222,-240,-253,-254,-245,-220,-195,-160,-124,-81,-53,-26,19,68); anim_8_x=new Array(-20,20,-35,39,0,45,-1,24,-15,14,-20,35,-18,38,-11,16,49,64,81,93,100,103,109); anim_8_y=new Array(-20,-20,-32,-42,-62,-76,-89,-107,-132,-147,-173,-180,-192,-209,-236,-193,-119,-73,-24,51,95,130,188); anim_9_x=new Array(-20,-51,-89,-110,-165,-191,-228,-240,-259,-271,-277,-281,-287); anim_9_y=new Array(-20,-20,-35,-37,-34,-16,10,47,105,150,189,227,273);
[code] Baloncuklu mouse [/code]
[code] | |
|