html - How would I use javascript to make an image "jiggle" or "shiver"? -
so question simple, i'm building webpage in html , want incorporate little javascript make image "vibrate" or "jiggle" move , forth in relatively tight space/pattern.
i did research , found this:
copy below code , paste <head> section of page example:<head>code here</head> <style> .jc{ position:relative; } </style> <script language="javascript1.2"> var ns6=document.getelementbyid&&!document.all var ie=document.all var customcollect=new array() var i=0 function jiggleit(num){ if ((!document.all&&!document.getelementbyid)) return; customcollect[num].style.left=(parseint(customcollect[num].style.left)==-1)? customcollect[num].style.left=1 : customcollect[num].style.left=-1 } function init(){ if (ie){ while (eval("document.all.jiggle"+i)!=null){ customcollect[i]= eval("document.all.jiggle"+i) i++ } } else if (ns6){ while (document.getelementbyid("jiggle"+i)!=null){ customcollect[i]= document.getelementbyid("jiggle"+i) i++ } } if (customcollect.length==1) setinterval("jiggleit(0)",80) else if (customcollect.length>1) (y=0;y<customcollect.length;y++){ var tempvariable='setinterval("jiggleit('+y+')",'+'100 )' eval(tempvariable) } } window.onload=init </script> paste anywhere wish image appear <span id="jiggle0" class="jc"><b>your image url here</b></span> they called "shivering pic" , gave example... want. did described it. added code said needed, copied right parts (none of directions), , made sure in right place.
i tested out there no image! there nothing! realized because using black background, , if there text, black, happening was merely showing url of image want add in (i see once highlighted it). regardless, still no image (just text), , still no vibrating/jittering/shivering/jiggling. did note there bold tags right suggests add image url... me make seem putting in text.
please help! how make code work, or how make image "shiver"?
this want :
Comments
Post a Comment