账号通
    

账号  

密码  

1205

查看

0

回复
主题:热心的朋友帮忙解答一个JS问题. [收藏主题]  
mzh63385279 当前离线

61

主题

0

广播

0

粉丝
添加关注
级别:学前班

用户积分:681 分
登录次数:53 次
注册时间:2009/5/8
最后登录:2009/8/21
mzh63385279 发表于:2009/8/13 17:14:00   | 只看该作者 查看该作者主题 楼主 

我是用的V6 data2 的首页模版, 中间[第一个滑门]是定时5秒切换的滑门,在IE浏览器下正常. 但是在火狐浏览器下不能动.并且也不能手动切换. 所以请热心肠的朋友们帮帮我.



<html>
<head>
<title>{$GetSiteName}</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<meta http-equiv=X-UA-Compatible content=IE=7>
<link href="{$GetInstallDir}images/index.css" type=text/css rel=stylesheet>
<script src="{$GetInstallDir}images/ks0.js"></script>
</head>
<body>
{LB_头部通用-首页}
<!--首页主体开始-->
<div class="container">
 <div id="content">
  <div class="ihp1">
   <div class="bhp1">
    <div class="ihp1_l">
     <div class="ihp1_l1">
        <ul class="ay_list01">{LB_首页幻灯片文章}</ul>
     </div>
    </div>
    <!--第一滑动门特效开始--> 
    <div class="ihp1_r">
     <div class="news_cen" id="taga1">
      <div class="sy1_t01" id=sy1_0 name="t">
       <div class="newst01"><A href="#">精选软件</A></div>
      </div>
      <div class="w1px"></div>
      <div class="sy1_t02" id=sy1_1 name="t">
       <div class="newst02"><A href="#">热门文章</A></div>
      </div>
      <div class="w1px"></div>
      <div class="sy1_t02" id=sy1_2 name="t">
       <div class="newst02"><A href="#">经典教程</A></div>
      </div>
      <div class="w1px"></div>
      <div class="sy1_t02" id=sy1_3 name="t">
       <div class="newst02"><A href="#">美图视觉</a></div>
      </div>
     </div>
  
     <div id="foda1">
      <div class="dis" id="ihp1_r0" name="f">
       <div class="dr_hp2_2l">{LB_精选软件}
                             <div class="jinriht"> 
          <p class="ht_title">热点话题</p>
         <ul>
          <li>{LB_精选软件-头条推荐}</li>
         </ul>
        </div>
        <div class="clear"></div>
       </div>
       <div class="dr_hp2_2r">
        <div class="cen_div">{SQL_通用头条()}</div>
        <div class="clear"></div>
        <ul class="ay_list02">
          <li>{LB_首页新闻}</li>
        </ul>
       </div>
      </div>
      <div class="clear"></div>


     <!--新闻结束-->
      <div class="undis" id="ihp1_r1" name="f">
       <div class="dr_hp2_2l">{LB_推荐财经新闻}
        <div class="jinriht">
         <p class="ht_title">热点话题</p>
         <ul>
          <li>{LB_热门财经新闻}</li>
         </ul>
        </div>
       </div>
       <div class="dr_hp2_2r">
        <div class="cen_div">{SQL_通用头条(20098646182135)}</div>
        <div class="clear"></div>
        <ul class="ay_list02">
         <li>{LB_首页财经新闻}</li>
        </ul>
       </div>
      </div>
      <div class="clear"></div>
     <!--财经结束-->
      <div class="undis" id="ihp1_r2" name="f">
       <div class="dr_hp2_2l">{LB_推荐娱乐新闻}
        <div class="jinriht">
         <p class="ht_title">热点话题</p>
         <ul>{LB_热门娱乐新闻}</ul>
        </div>
       </div>
       <div class="dr_hp2_2r">
        <div class="cen_div">{SQL_通用头条(20094459079850)}</div>
        <div class="clear"></div>
        <ul class="ay_list02">
         <li>{LB_首页娱乐新闻}</li>
        </ul>
       </div>
      </div>
      <div class="clear"></div>
     <!--娱乐新闻结束-->
      <div class="undis" id="ihp1_r3" name="f">
       <div class="sy_list15">
        <ul>
         <li>{LB_图片视觉}</li>
        </ul>
       </div>
       <div class="clear"></div>
      </div>
     <!--图片视觉结束-->
     </div>
    <!--滑动门结束-->
    </div>
   </div>
  </div>
 </div>
 <div class="ihp2">
  <div class="ihp2_1">
   <div class="ihp2_t01">
    <div class="t01_sty">看看大家都在忙什么</div>
   </div>
   <ul class="other_list">
    {=GetUserDynamic(8)}
   </ul>
    <div class="clear"></div>
  </div>
 </div>


<!--大家在忙什么结束-->
{LB_底部通用}
</div>
<SCRIPT language=javascript>
 var loopTime = 5000;
 var isLoopGlobe=true;
 function wp(id,titshow,conshow,titnone,connone,isLoop){
  isLoopGlobe=false;
  var o = document.getElementById(id);
  var doLoop = o.id.split("_")[1];//开始循环的tag
  var handle;//循环的setTimeout句柄
 
  var _isIE = navigator.userAgent.indexOf("MSIE")>=0?true:false;
  var tit_DivArray_tmp = o.parentNode.getElementsByTagName("div");//tag标签数组
  var tit_DivArray=new Array();
  for(var i=0;i<tit_DivArray_tmp.length;i++){
   if(tit_DivArray_tmp[i].getAttribute("name")=="t"){


    tit_DivArray[tit_DivArray.length]=tit_DivArray_tmp[i];
   }
  }
 
  var con_DivArray_tmp;
  var con_DivArray=new Array();


  if(_isIE){
   con_DivArray_tmp = o.parentNode.nextSibling.getElementsByTagName("div");
  }else{
   //var x="";
   //for   (content   in   eval(o.parentNode))  
    // x=x   +     ".<font   color=red>"   +   content   +   "</font>="   +   eval(o.parentNode)[content]+"<br>";  
     //document.write(x);  
  
   con_DivArray_tmp = o.parentNode.nextSibling.nextSibling.getElementsByTagName("div");
  }
  for(var i=0;i<con_DivArray_tmp.length;i++){
   if(con_DivArray_tmp[i].getAttribute("name")=="f"){
    con_DivArray[con_DivArray.length]=con_DivArray_tmp[i];
   }
  }


  for(var i=0;i<tit_DivArray.length;i++){
  //alert(tit_DivArray[i].getAttribute("id").split("_")[1]==o.getAttribute("id").split("_")[1]);
   if(tit_DivArray[i].getAttribute("id").split("_")[1]==o.getAttribute("id").split("_")[1]){
    //tit_DivArray[i].className = titshow;
    //con_DivArray[i].className = conshow;
    tit_DivArray[i].setAttribute('class',titshow);
    tit_DivArray[i].setAttribute('className',titshow);
    con_DivArray[i].setAttribute('class',conshow);
    con_DivArray[i].setAttribute('className',conshow);
   }else{
    //tit_DivArray[i].className = titnone;
    //con_DivArray[i].className = connone;
    tit_DivArray[i].setAttribute('class',titnone);
    tit_DivArray[i].setAttribute('className',titnone);
    con_DivArray[i].setAttribute('class',connone);
    con_DivArray[i].setAttribute('className',connone);
   }
  }


  if(isLoop){
   doLoop++;
   if(doLoop>tit_DivArray.length-1 || doLoop<0){
    doLoop = 0;
   }
   id=id.split("_")[0]+"_"+doLoop;
   o.parentNode.handle=setTimeout("wp('"+ id +"','"+titshow+"','"+conshow+"','"+titnone+"','"+connone+"',"+ isLoop +")",loopTime);
  }else{
   clearTimeout(o.parentNode.handle);
  }
 
 }
 function addEvent(objId,id){
  var obj=document.getElementById(objId);
  if(window.addEventListener){ // Mozilla, Netscape, Firefox
         obj.addEventListener('mouseover', wp(id,'sy1_t01','dis','sy1_t02','undis',false), false);
         obj.addEventListener('mouseout', wp(id,'sy1_t01','dis','sy1_t02','undis',false), true);
     } else { // IE
         obj.attachEvent('onmouseover',  function(){wp(id,'sy1_t01','dis','sy1_t02','undis',false);});
         obj.attachEvent('onmouseout',  function(){wp(id,'sy1_t01','dis','sy1_t02','undis',true);});
     }
 }
 addEvent("sy1_0","sy1_0");
 addEvent("sy1_1","sy1_1");
 addEvent("sy1_2","sy1_2");
 addEvent("sy1_3","sy1_3");
 addEvent("ihp1_r0","sy1_0");
 addEvent("ihp1_r1","sy1_1");
 addEvent("ihp1_r2","sy1_2");
 addEvent("ihp1_r3","sy1_3");
 function doLoad(){
  if(isLoopGlobe){
   document.getElementById('foda1').parentNode.handle=setTimeout("wp('sy1_0','sy1_t01','dis','sy1_t02','undis',true)",loopTime);
  }
  //document.getElementById('con_1').parentNode.handle=setTimeout("wp('tag1_0',true)",loopTime);
  //document.getElementById('con_2').parentNode.handle=setTimeout("wp('tag2_0',true)",loopTime);
 }
</SCRIPT>
</body>
</html>

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.07813秒 powered by KesionCMS 9.0