<div id="testit" style="width:50px; height:32px; background-image:url(bg.png);background-repeat:no-repeat;background-position:0px 0px;" οnmοuseοver="popup();" οnmοuseοut="popdn();"></div>
<script language="javascript">
var te=0;
var te2=5;
var arrbg=new Array();
var doit
var doit1
arrbg[0]="0px 0px";
arrbg[1]="-51px 0px";
arrbg[2]="-103px 0px";
arrbg[3]="-155px 0px";
arrbg[4]="-207px 0px";
arrbg[5]="-207px 3px";
function popup(){
te=0;
doit=setInterval("pp()",50);//隔50毫秒运行pp()
}
function pp(){
if(te<=5){
document.getElementById("testit").style.backgroundPosition=arrbg[te];
te=te+1;
}
else{
clearInterval(doit);
}
}
function popdn(){
te2=5;
doit1=setInterval("pd()",50);
}
function pd(){
if(te2>=0){
document.getElementById("testit").style.backgroundPosition=arrbg[te2];
te2=te2-1;
}
else{
clearInterval(doit1);
}
}
</script>