问题描述
要求图片循环滚动左右控制,鼠标指针放到图片上显示该图片的名称,下面代码在ie8下正常显示,但在ie6ie7下显示不正常!请各位大侠帮下小弟!另发现在ie8下第一遍图片滚动完毕后第二遍图片下面没有显示文字<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><styletype="text/css">.rollBox{width:980px;overflow:hidden;}.rollBox.LeftBotton{height:127px;width:28px;padding-top:100px;overflow:hidden;float:left;display:inline;margin:0;cursor:pointer;}.rollBox.RightBotton{height:127px;width:28px;overflow:hidden;padding-top:100px;float:left;display:inline;margin:0;cursor:pointer;}.rollBox.Cont{width:924px;overflow:hidden;float:left;}.rollBox.ScrCont{width:10000000px;}.rollBox.Cont.pic{position:relative;list-style:none;width:225px;float:left;margin-right:10px;text-align:center;}.rollBox.Cont.pic.zhushi{color:#fff;font-weight:bold;visibility:hidden;overflow:auto;position:absolute;width:218px;height:30px;line-height:30px;background:#171717;filter:alpha(opacity=60);-moz-opacity:0.6;-khtml-opacity:0.6;opacity:0.6;left:3px;top:168px;}.rollBox.Contlia{display:block;}.rollBox.ContLIa:link,#.procate_list.bcLIa:visited,.procate_list.bcLIa:active{color:#000}.rollBox.ContLIa:hover{color:#008aff}.rollBox.Cont.picimg{width:221px;padding:1px;display:block;margin:0auto;}.rollBox.Conta:link,.rollBox.Conta:visited{color:#626466;text-decoration:none;}.rollBox.Conta:hover{color:#f00;}.rollBox#List1,.rollBox#List2{float:left;}</style><scripttype="text/javascript">functionlayer_show(layer_name,action){if(action=="show"){document.getElementById(layer_name).style.visibility="visible";}elseif(action=="hide"){document.getElementById(layer_name).style.visibility="hidden";}}</script><title>无标题文档</title></head><body><divclass="rollBox"><divclass="LeftBotton"onmousedown="ISL_GoUp()"onmouseup="ISL_StopUp()"onmouseout="ISL_StopUp()"><imgsrc="images/left.gif"width="25"height="31"/></div><divclass="Cont"style="margin-top:12px;"id="ISL_Cont"><divclass="ScrCont"><!--图片列表begin--><ulid="List1"><liclass="pic"><divid="zhushi_text"class="zhushi">图片文字</div><ahref="#"><imgsrc="images/tu1.gif"width="225"height="198"onmouseout="layer_show('zhushi_text','hide')"onmouseover="layer_show('zhushi_text','show')"/></a></li><liclass="pic"><divid="zhushi_text1"class="zhushi">图片文字1</div><ahref="#"><imgsrc="images/tu2.gif"width="225"height="198"onmouseout="layer_show('zhushi_text1','hide')"onmouseover="layer_show('zhushi_text1','show')"/></a></li><liclass="pic"><divid="zhushi_text2"class="zhushi">图片文字2</div><ahref="#"><imgsrc="images/tu3.gif"width="225"height="198"onmouseout="layer_show('zhushi_text2','hide')"onmouseover="layer_show('zhushi_text2','show')"/></a></li><liclass="pic"><divid="zhushi_text3"class="zhushi">图片文字3</div><ahref="#"><imgsrc="images/tu4.gif"width="225"height="198"onmouseout="layer_show('zhushi_text3','hide')"onmouseover="layer_show('zhushi_text3','show')"/></a></li><liclass="pic"><divid="zhushi_text4"class="zhushi">图片文字4</div><ahref="#"><imgsrc="images/tu1.gif"width="225"height="198"onmouseout="layer_show('zhushi_text4','hide')"onmouseover="layer_show('zhushi_text4','show')"/></a></li><liclass="pic"><divid="zhushi_text5"class="zhushi">图片文字5</div><ahref="#"><imgsrc="images/tu2.gif"width="225"height="198"onmouseout="layer_show('zhushi_text5','hide')"onmouseover="layer_show('zhushi_text5','show')"/></a></li><liclass="pic"><divid="zhushi_text6"class="zhushi">图片文字6</div><ahref="#"><imgsrc="images/tu3.gif"width="225"height="198"onmouseout="layer_show('zhushi_text6','hide')"onmouseover="layer_show('zhushi_text6','show')"/></a></li><liclass="pic"><divid="zhushi_text7"class="zhushi">图片文字7</div><ahref="#"><imgsrc="images/tu4.gif"width="225"height="198"onmouseout="layer_show('zhushi_text7','hide')"onmouseover="layer_show('zhushi_text7','show')"/></a></li><liclass="pic"><divid="zhushi_text8"class="zhushi">图片文字8</div><ahref="#"><imgsrc="images/tu1.gif"width="225"height="198"onmouseout="layer_show('zhushi_text8','hide')"onmouseover="layer_show('zhushi_text8','show')"/></a></li><!--图片列表end--></ul><ulid="List2"></ul></div></div><divclass="RightBotton"onmousedown="ISL_GoDown()"onmouseup="ISL_StopDown()"onmouseout="ISL_StopDown()"><imgsrc="images/right.gif"width="25"height="31"/></div><scriptlanguage="javascript"type="text/javascript"><!--//--><![CDATA[//><!--//图片滚动列表varSpeed=0.1;//速度(毫秒)varSpace=10;//每次移动(px)varPageWidth=235;//翻页宽度varfill=0;//整体移位varMoveLock=false;varMoveTimeObj;varComp=0;varAutoPlayObj=null;GetObj("List2").innerHTML=GetObj("List1").innerHTML;GetObj('ISL_Cont').scrollLeft=fill;GetObj("ISL_Cont").onmouseover=function(){clearInterval(AutoPlayObj);}GetObj("ISL_Cont").onmouseout=function(){AutoPlay();}AutoPlay();functionGetObj(objName){if(document.getElementById){returneval('document.getElementById("'+objName+'")')}else{returneval('document.all.'+objName)}}functionAutoPlay(){//自动滚动clearInterval(AutoPlayObj);AutoPlayObj=setInterval('ISL_GoDown();ISL_StopDown();',5000);//间隔时间}functionISL_GoUp(){//上翻开始if(MoveLock)return;clearInterval(AutoPlayObj);MoveLock=true;MoveTimeObj=setInterval('ISL_ScrUp();',Speed);}functionISL_StopUp(){//上翻停止clearInterval(MoveTimeObj);if(GetObj('ISL_Cont').scrollLeft%PageWidth-fill!=0){Comp=fill-(GetObj('ISL_Cont').scrollLeft%PageWidth);CompScr();}else{MoveLock=false;}AutoPlay();}functionISL_ScrUp(){//上翻动作if(GetObj('ISL_Cont').scrollLeft<=0){GetObj('ISL_Cont').scrollLeft=GetObj('ISL_Cont').scrollLeft+GetObj('List1').offsetWidth}GetObj('ISL_Cont').scrollLeft-=Space;}functionISL_GoDown(){//下翻clearInterval(MoveTimeObj);if(MoveLock)return;clearInterval(AutoPlayObj);MoveLock=true;ISL_ScrDown();MoveTimeObj=setInterval('ISL_ScrDown()',Speed);}functionISL_StopDown(){//下翻停止clearInterval(MoveTimeObj);if(GetObj('ISL_Cont').scrollLeft%PageWidth-fill!=0){Comp=PageWidth-GetObj('ISL_Cont').scrollLeft%PageWidth+fill;CompScr();}else{MoveLock=false;}AutoPlay();}functionISL_ScrDown(){//下翻动作if(GetObj('ISL_Cont').scrollLeft>=GetObj('List1').scrollWidth){GetObj('ISL_Cont').scrollLeft=GetObj('ISL_Cont').scrollLeft-GetObj('List1').scrollWidth;}GetObj('ISL_Cont').scrollLeft+=Space;}functionCompScr(){varnum;if(Comp==0){MoveLock=false;return;}if(Comp<0){//上翻if(Comp<-Space){Comp+=Space;num=Space;}else{num=-Comp;Comp=0;}GetObj('ISL_Cont').scrollLeft-=num;setTimeout('CompScr()',Speed);}else{//下翻if(Comp>Space){Comp-=Space;num=Space;}else{num=Comp;Comp=0;}GetObj('ISL_Cont').scrollLeft+=num;setTimeout('CompScr()',Speed);}}//--><!]]></script></div></body></html>
解决方案
本帖最后由 jmlgc 于 2011-11-11 11:17:17 编辑
解决方案二:
就没有高手帮我看看?55555555555