Cuando se pasa el cursor por encima de la imágen, está vibra con lo que se
consigue que el usuario centre su atención sobre ella.
Copia y pega el siguiente código entre las etiquetas <HEAD></HEAD>:
<style>
.shakeimage{
position:relative
}
</style>
<script language="JavaScript1.2">
/*
Por Cortesía de Mundo JavaScript (http://www.mundojavascript.com)
*/
//configura aquí la intensidad del movimiento aumentando o disminuyendo el número
var rector=5
///////No escribas a partir de aquí///////////
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
}
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
}
</script>
Ahora las etiquetas IMG que definen la imágen tienen que tener este código en sus entrañas:
<img src="TUIMAGEN.gif" class="shakeimage" onMouseOver="init(this);rattleimage()" onMouseOut="stoprattle(this)">
Si deseas colaborar enviando tu artículo, puedes acerlo a esta dirección de correo: admin@jaterli.com Será revisado y publicado tan pronto como nos sea posible. Gracias!!