展开全部
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
body{margin:0;padding:0;font-size:12px;color:#666;background:#ccc;}
img{border:none;}
a{text-decoration:none;color:#666;font-size:12px;}
#box{margin:100px auto;width:450px;height:280px;background:#6666cc;overflow:hidden;
position:relative;border:6px solid #ddd;}
#box #img{width:1820px;height:280px;display:block;overflow:hidden;background:#fff;}
#box #img a{float:left;width:450px;height:280px;display:block;overflow:hidden;}
#box #num{position:absolute;left:340px;top:250px;}
#box #num a{width:18px;height:18px;display:block;text-align:center;line-height:18px;float:left;
margin-left:5px;background:#ddd;filter:alpha(opacity=40);opacity:0.4;overflow:hidden;}
#box #num a:hover,#box #num a.hover{opacity:0.9;filter:alpha(opacity=90);background:#fff;color:#3399ff;}
1
2
3
4
src="http://caac.people.com.cn/mediafile/201005/28/F201005281448063041613125.jpg" />
src="http://i.weather.com.cn/images/cn/climate/2010/12/07/E6DCE96F021CD72EBAFA7E073740B290.jpg" />
D2/pic/item/8bbc98c088041f843bdb4960.jpg" target="_blank" >
" /> function S$(i){return document.getElementById(i)} function S$$(e,p){return p.getElementsByTagName(e)} var slideImage=function(){ var d,s,da,sa,st=10,w,sp,acls,MID,AID,isAuto=1,dir=1,lst=0,pos,cur=0,A,C,t=800,k=0,at=3000; return{ init:function(dst,src,width,time,interval,aclass){ w=width;st=interval;t=time/st;acls=aclass; d=S$(dst); da=S$$("a",d); s=S$(src); sa=S$$("a",s); d.onmouseover=function(){clearInterval(AID);}; d.onmouseout=function(){AID=setInterval("slideImage.autoplay()",at);}; AID=setInterval("slideImage.autoplay()",at); for(var i=0;isa[i].onmouseover=function(){ j=0;while(jclearInterval(AID);slideImage.slide(j-1); }; sa[i].onmouseout=function(){AID=setInterval("slideImage.autoplay()",at);}; } }, slide:function(i){ if(i!=lst){ sa[lst].className="";sa[i].className=acls; lst=i;cur=i; C=-i*w; A=(-C+parseInt(d.style.marginLeft))/t/t/t;k=0; clearInterval(MID);MID=setInterval(function(){slideImage.mv();},st); } }, mv:function(){ sp=A*Math.abs(Math.pow(k-t,3)); if(Math.abs(sp)d.style.marginLeft=sp+C;k++; }, autoplay:function(){ if(cur==3)dir=-1;if(cur==0)dir=1; this.slide(cur+dir); } } }();
" /> function S$(i){return document.getElementById(i)} function S$$(e,p){return p.getElementsByTagName(e)} var slideImage=function(){ var d,s,da,sa,st=10,w,sp,acls,MID,AID,isAuto=1,dir=1,lst=0,pos,cur=0,A,C,t=800,k=0,at=3000; return{ init:function(dst,src,width,time,interval,aclass){ w=width;st=interval;t=time/st;acls=aclass; d=S$(dst); da=S$$("a",d); s=S$(src); sa=S$$("a",s); d.onmouseover=function(){clearInterval(AID);}; d.onmouseout=function(){AID=setInterval("slideImage.autoplay()",at);}; AID=setInterval("slideImage.autoplay()",at); for(var i=0;isa[i].onmouseover=function(){ j=0;while(jclearInterval(AID);slideImage.slide(j-1); }; sa[i].onmouseout=function(){AID=setInterval("slideImage.autoplay()",at);}; } }, slide:function(i){ if(i!=lst){ sa[lst].className="";sa[i].className=acls; lst=i;cur=i; C=-i*w; A=(-C+parseInt(d.style.marginLeft))/t/t/t;k=0; clearInterval(MID);MID=setInterval(function(){slideImage.mv();},st); } }, mv:function(){ sp=A*Math.abs(Math.pow(k-t,3)); if(Math.abs(sp)d.style.marginLeft=sp+C;k++; }, autoplay:function(){ if(cur==3)dir=-1;if(cur==0)dir=1; this.slide(cur+dir); } } }();
展开全部
document.onkeydown ///键盘事件代码
用函数来处理
document.onkeydown=key
function key(){
switch(event.keyCode){
case 37:{ //37是左箭头
}break
case 39:{ //39 是右箭头
//你想干嘛呢... 读取数据库.. 换图片地址... 随便...
}break
}
}
用函数来处理
document.onkeydown=key
function key(){
switch(event.keyCode){
case 37:{ //37是左箭头
}break
case 39:{ //39 是右箭头
//你想干嘛呢... 读取数据库.. 换图片地址... 随便...
}break
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
要那种的?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询