模拟google首页动画图标的
2008-12-15 23:48
585 查看
<div id="testit" style="width:50px; height:32px; background-image:url(bg.png);background-repeat:no-repeat;background-position:0px 0px;" onmouseover="popup();" onmouseout="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>
相关文章推荐
- [源码]google首页图标JS动画
- Google韩国首页图标动画效果
- google曾经的首页小图标,JS+CSS实现的动画效果
- google首页动画(模拟flash帧)
- Google韩国首页图标动画效果
- Google首页的图标动画效果,很传神吧?自己也能完美实现,进来请看!!
- Google 首页用 Javascript 和 Css 实现舞蹈家跳舞的动画
- 模仿google首页图片动画效果 (css+javascript)
- 模拟Google首页(dwr实现ajax)
- google的首页动画效果[JS]
- 模拟Google首页(dwr实现ajax)
- JS+CSS实现Google首页的动画效果
- 利用CSS和javascript实现Google首页的动画效果
- [原]模仿Google首页的PNG动画效果
- 闲来无事,写了段js仿google首页动画,附源码下载
- dwr框架模拟google首页
- 模拟动画图标
- 模拟Google首页(dwr实现ajax) 弹出补全搜索结果
- 今天google 首页的javascript 动画实现。好吧,我来晚了。。。
- 模拟Google首页(dwr实现ajax) 弹出补全搜索结果