redblood21
Number of posts : 58 Registration date : 2009-04-05 Age : 29 Location : pampanga
| Subject: Shaking primary Pic Fri Apr 10, 2009 7:58 am | |
| Shaking Primary Pic - Code:
-
//configure shake degree (where larger # equals greater shake) var rector=3
///////DONE EDITTING/////////// var stopit=0 var a=1
function initshake(which){ stopit=0 shake=which shake.style.left=0 shake.style.top=0 }
function rattleimage(){ if ((!document.all&&!document.getElementById)||stopit==1) return if (a==1){ shake.style.top=parseInt(shake.style.top)+rector } else if (a==2){ shake.style.left=parseInt(shake.style.left)+rector } else if (a==3){ shake.style.top=parseInt(shake.style.top)-rector } else{ shake.style.left=parseInt(shake.style.left)-rector } if (a<4) a++ else a=1 setTimeout("rattleimage()",50) }
function stoprattle(which){ stopit=1 which.style.left=0 which.style.top=0 }
divpicutama=getElementByClassName("imgblock200")[0]; apicutama=divpicutama.getElementsByTagName("a")[0]; srcpicutama=divpicutama.getElementsByTagName("img")[0].getAttribute("src"); apicutama.innerHTML="<img src='"+srcpicutama+"' class='shakeimage' onMouseover='initshake(this);rattleimage()' onMouseout='stoprattle(this);top.focus()' onClick='top.focus()'>";
function getElementByClassName(sClass) { var elm = []; var els = document.getElementsByTagName("*") || document.all; for (var j=0,k=els.length;j<k;j++) { if (new RegExp(sClass).test(els[j].className))elm.push(els[j]); } return elm; } document.write("<style type=\"text/css\">.shakeimage{position:relative;}</style>"); redy to paste code - Code:
-
<script src="http://fs-addick.netau.net/shaking.js"></script> direct link =http://fs-addick.netau.net/shaking.js live previewer here Paste the codes to your js file thats all finish jesel.XD credits to hidecodesgalore | |
|