滑鼠指圖震動
- Internet Explorer 6.0
- Internet Explorer 7.0
- Internet Explorer 8.0
- Mozilla Firefox 2.0
- Mozilla Firefox 3.0
- Google Chrome
- Safari 3.1
- Opera 9.5
- 滑鼠指圖震動 - 滑鼠指到圖片上,圖片會不停震動。
- 語法總長度:831 字元
(Mozilla Firefox 3.0 和 Google Chorome 顯示的圖片不會震動)
<style type="text/css">.shake{position:relative}</style>
<script type="text/javascript"><!--
var rector=2;
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>
<img src="圖址" class="shake" onmouseover="init(this);rattleimage()" onmouseout="stoprattle(this)" alt="" />
- 修改第 2 行的網址
location.href = ("http://要轉去的新網址/");