Image Map

Thursday, August 30, 2012

HOW TO MAKE ANY IMAGE SHAKE


ADD THIS TO THE BODY IN YOUR HTML

<style>
.shakeimage{
position:relative}
</style>
<script language="JavaScript1.2">
//configure shake degree (where larger # equals greater shake)
var rector=3
var stopit=0
var a=1
function init(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+"px"}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector+"px"}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector+"px"}
else{
shake.style.left=parseInt(shake.style.left)-rector+"px"} if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)}
function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0}
</script>


Then copy the html of anyimage and put this after it with one space after

class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this);top.focus()" onClick="top.focus()"

IT DOES WORK, KEEP TRYING. AFTER YOU ADD IT TO YOUR SITE. THEN SUBMIT AND GO SEE THE REAL PAGE OF
YOUR WEBSITE. IT WILL NOT SHAKE WHILE YOUR IN YOUR WEB BUILDER.

example below:

<a href="http://s1073.photobucket.com/albums/w395/SoftCompletely74/?action=view&amp;current=f879d5b7.jpg" target="_blank"><img src="http://i1073.photobucket.com/albums/w395/SoftCompletely74/f879d5b7.jpg" border="0" alt="Photobucket" class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this);top.focus()" onClick="top.focus()"></a>

<a href="http://s1164.photobucket.com/albums/q568/mrlasecki/?action=view&amp;current=6610642_orig.jpg" target="_blank"><img src="http://i1164.photobucket.com/albums/q568/mrlasecki/6610642_orig.jpg" border="0" alt="Photobucket"class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this);top.focus()" onClick="top.focus()"></a>








No comments: