ext例子上就有,可以去看一下
解决方案 »
- jsp展示sql server 2000数据页面不显示,但调试信息中有
- 帮帮忙,下面代码提示有错误,怎么解决呀
- JavaScript 如何嵌入一张网页为其初始化变量?
- 【求助】ext的问题 !
- 古怪问题求助 javascript document.execCommand 中 SaveAs 命令保存Web页面中间出现换行问题
- 怎么屏蔽掉初始页面上的地址栏和菜单栏?
- 动态生成了一个button,哪怎么实现onclick事件呢
- div 自适应屏幕宽度 高度?
- flot x轴和y轴刻度没有对齐,有人来围观下吗
- 请教cancelBubble是干什么用的???
- 验证输入的密码格式
- javascript参数传递
有没有简单一点的例子啊?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-cn" lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='keywords' content='' />
<meta name='description' content='' />
<title>用javascript来实现图片动画</title>
<style>
<!--
/*我直接把CSS写这了*/
div.header{width:1000px;height:200px;margin:0 auto;position:relative}
.Gnb_btn_div{width:90px;height:75px;overflow:hidden;display:block;position:absolute;}
.Gnb_btn_img{width:100%;height:525px;display:block;overflow:hidden;text-indent:-500px;}
#gnb_btn_01 .Gnb_btn_img {background-image: url(/upload/remotupload/200814115721261.gif)}
#gnb_btn_01 {bottom:12px;left:160px; }
-->
</style>
</head>
<body>
<div class="header">
<h2>一个演示,by麦鸡 </h2>
<p>鼠标经过图表,看效果,测试通过ie6+,ff2,opera9<br />转载麻烦请注明 <a href="http://www.macji.com/blog">麦鸡的博客,http:www.macji.com/blog</a></p>
<div class="Gnb_btn_div" id="gnb_btn_01"><a class="Gnb_btn_img" href="http://www.macji.com/blog">找朋友</a></div>
</div>
<script type="text/javascript">
// <![CDATA[
function GNB(_7c){
this.iImgNum=7;
this.iImgHeight=75;
this.iOverSpeed=50;
this.iOutSpeed=50;
this.eventObj=_7c;
this.MouseOverFlag=false;
this.imageIndex=0;
if(this.eventObj==null){return;}
this.eventObj.parentClass=this;this.eventAssign();
}
GNB.prototype.eventAssign=function(){
this.eventObj.onmouseover=this.menuMouseOver;
this.eventObj.onmouseout=this.menuMouseOut;
};
GNB.prototype.menuMouseOver=function(){
if(this.parentClass.MouseOverFlag!=false){return;}
this.parentClass.MouseOverFlag=true;
this.parentClass.clearTimeOut();
this.parentClass.menuMouseOverTimer();
};
GNB.prototype.menuMouseOut=function(){
this.parentClass.MouseOverFlag=false;
this.parentClass.clearTimeOut();
this.parentClass.menuMouseOutTimer();
};
GNB.prototype.menuMouseOverTimer=function(){
var _7d=this;
if(this.imageIndex>=this.iImgNum){return;}
this.eventObj.scrollTop=this.imageIndex*this.iImgHeight;
this.imageIndex++;
this.setTimerID=setTimeout(function(){_7d.menuMouseOverTimer();},this.iOverSpeed);
};
GNB.prototype.menuMouseOutTimer=function(){
var _7e=this;if(this.imageIndex<0){return;}
this.eventObj.scrollTop=this.imageIndex*this.iImgHeight;
this.imageIndex--;
this.setTimerID=setTimeout(function(){_7e.menuMouseOutTimer();},this.iOutSpeed);
};
GNB.prototype.clearTimeOut=function(){
clearTimeout(this.setTimerID);
};
var GNB1=new GNB(document.getElementById("gnb_btn_01"));
//]]>
</script>
</body>
</html>
这个挺好的,还有JQuery版本的,很简单。。楼主去看看