earlskiee23
Number of posts : 11 Registration date : 2009-04-24 Age : 31 Location : bohol
| Subject: shaking image when hover Sun Apr 26, 2009 7:33 am | |
| just put this in your JS extension... - Code:
-
/**************************************************/ /* Image shake - Friendster Tweaks */ /* by: Archer - [url=http://www.friendsterforum.com%c2%a0/]www.friendsterforum.com [/url] */ /* adjust the value of speed and radius */ /**************************************************/
pics = document.getElementsByTagName('img') FF = "Netscape" IE = "Microsoft Interner Explorer" radius=8 speed=5 a = 0
function tagAllPics(){ for(x=0; x<pics.length;x++){ if(navigator.appName==FF){ pics[x].setAttribute("onmouseover","tagX("+x+")") pics[x].setAttribute("onmouseout","tagY("+x+")") }
else{ psrc = pics[x].getAttribute("src") pid = pics[x].getAttribute("id") pcls = pics[x].getAttribute("class") pics[x].outerHTML= "<img id="+pid+" class="+pcls+" src="+psrc+ " onmouseover=tagX("+x+") onmouseout=tagY("+x+")>"} } }
function tagX(x){ pics[x].style.position="relative" moveIt = setInterval("orbit("+x+")",5) }
function tagY(x){ pics[x].style.top = "0" pics[x].style.left= "0" window.clearInterval(moveIt) }
function orbit(x){ pics[x].style.top= radius*Math.cos(a/speed) pics[x].style.left=radius*Math.sin(a/speed) a++;} setTimeout("tagAllPics()", 1000) | |
|