最近做了个网站,快五一了要在上面挂两个庆祝标语,写的代码在一个页面上两边的漂浮窗口可以随下拉列表移动,另一个页面却移不动,这是为什么??那位能帮帮我。
下面是代码 不过我想代码应该不会有什么问题,因为两个页面用的是同一个代码和JS。问题可能出在我的页面上。那位遇到过同样的问题
<!--浮动图标开始--><!--左侧-->
<script LANGUAGE='JavaScript'>
var ad_float_left_src = "images/5.1_3.jpg";
var ad_float_left_url = "images/"; //logo类型是图片时,方需要填入链接地址
var ad_float_left_type = "jpg"; //logo类型如果是Flash请改为"swf"
</script>
<script src=floatleft_close.js></script><!--右侧-->
<script LANGUAGE='JavaScript'>
var ad_float_right_src = "images/5.1_3.jpg";
var ad_float_right_url = "images/"; //logo类型是Flash时,不需要填入链接地址
var ad_float_right_type = "jpg"; //logo类型如果是图片请改为其它
</script>
<script src=floatright_close.js></script><!--浮动图标结束-->
</HTML>这是JS代码
document.ns = navigator.appName == "Microsoft Internet Explorer"var imgheight
var imgleft
window.screen.width>800 ? imgheight=100:imgheight=100
window.screen.width>800 ? imgleft=0:imgleft=0
function myload()
{
myleft.style.top=document.body.scrollTop+100-imgheight;
myleft.style.left=imgleft;
leftmove();
}
function leftmove()
 { 
 myleft.style.top=document.body.scrollTop+100-imgheight;
 myleft.style.left=imgleft;
 setTimeout("leftmove();",50)
 }function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true)if(document.ns){
if(ad_float_left_type!="swf")
document.write("<div id=myleft style='position: absolute;width:114;top:300;left:0;visibility: visible;z-index: 1'><a href='" + ad_float_left_url + "' target = '_blank'><img src='" + ad_float_left_src + "' WIDTH=114 HEIGHT=336  border = 0></a></div>");
else
document.write("<div id=myleft style='position: absolute;width:114;top:300;left:0;visibility: visible;z-index: 1'><EMBED src='" + ad_float_left_src + "' quality=high  WIDTH=114 HEIGHT=336 TYPE='application/x-shockwave-flash' id=changhongout ></EMBED></div>");
myload()
}document.ns = navigator.appName == "Microsoft Internet Explorer"var imgheight
var imgleft
window.screen.width>800 ? imgheight=100:imgheight=100
window.screen.width>800 ? imgleft=0:imgleft=0
function myload()
{
myleft.style.top=document.body.scrollTop+100-imgheight;
myleft.style.left=imgleft;
leftmove();
}
function leftmove()
 { 
 myleft.style.top=document.body.scrollTop+100-imgheight;
 myleft.style.left=imgleft;
 setTimeout("leftmove();",50)
 }function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true)function close_float_left(){
myleft.style.visibility='hidden';
}document.write("<style>"
+"A.closefloat:link,A.closefloat:visited {text-decoration:none;color:#000000;font-size:12px;line-height:18px;}"
+"A.closefloat:active,A.closefloat:hover {text-decoration:underline;color:#0000FF;font-size:12px;line-height:18px;}"
+"</style>");if(document.ns){
if(ad_float_left_type!="swf")
document.write("<div id=myleft style='position: absolute;width:114;top:300;left:0;visibility: visible;z-index: 1;' align='left'><a href='" + ad_float_left_url + "' target = '_blank'><img src='" + ad_float_left_src + "' WIDTH=114 HEIGHT=336  border = 0></a><a href='javascript:close_float_left();' class='closefloat'></a></div>");
else
document.write("<div id=myleft style='position: absolute;width:114;top:300;left:0;visibility: visible;z-index: 1' align='left'><EMBED src='" + ad_float_left_src + "' quality=high  WIDTH=114 HEIGHT=336 TYPE='application/x-shockwave-flash' id=changhongout ></EMBED></div>");
myload()
}

解决方案 »

  1.   

    左下角没有错误的显示,两个页面中有这个代码是用来图片移动的
    <DIV id="icefable2" align="center"><asp:datalist id="DataListPic" runat="server" Width="772px" Height="125px" ShowHeader="False"
    ShowFooter="False" RepeatDirection="Horizontal">
    <SelectedItemTemplate>
    <FONT face="宋体"></FONT>
    </SelectedItemTemplate>
    <ItemTemplate>
    <TABLE id="Table17" height="110" cellSpacing="0" cellPadding="0" width="133" border="0">
    <TR>
    <TD width="160"><FONT face="宋体">
    <asp:ImageButton id=ImageButton1 onclick=OnPicList_Click runat="server" Width="133px" ImageUrl='<%# ((DataRowView)Container.DataItem)["pic"]%>' Height="100px" CommandArgument='<%# ((DataRowView)Container.DataItem)["id"]%>' AlternateText='<%# ((DataRowView)Container.DataItem)["title"]%>'>
    </asp:ImageButton></FONT></TD>
    <TD width="10"><FONT face="宋体"></FONT></TD>
    </TR>
    <TR>
    <TD>
    <asp:HyperLink id=messageLink Runat="server" NavigateUrl='<%# "Article.aspx?id="+((DataRowView)Container.DataItem)["id"]%>' title='<%# ((DataRowView)Container.DataItem)["title"]%>' text='<%# mySubString(((DataRowView)Container.DataItem)["title"].ToString(),8)%>'>
    </asp:HyperLink></TD>
    </TR>
    </TABLE>
    </ItemTemplate>
    </asp:datalist></DIV>
    </font>
    <SCRIPT language="javascript">
    <!--
    marqueesHeight=760;
    stopscroll=false;
    with(icefable2){
      style.width=marqueesHeight;
      style.height=110;
      style.overflowX='hidden';
      style.overflowY='visible';
      noWrap=true;
      onmouseover=new Function('stopscroll=true');
      onmouseout=new Function('stopscroll=false');
      }
      preTop=0; currentLeft=100; stoptime=0;
    function init_srolltext(){
      icefable2.scrollLeft=0;
      setInterval('scrollUp()',40);//滚动速度
    }init_srolltext();function scrollUp(){
      if(stopscroll==true) return;
      currentLeft+=1;
      if(currentLeft==91)     //滚动距离
      {
       stoptime+=1;
       currentLeft-=1;
       if(stoptime==91) //滚动间距
       {
       currentLeft=0;
       stoptime=0;  
       }
      }  else {  
      preTop=icefable2.scrollLeft;
      icefable2.scrollLeft+=1;
      if(preTop==icefable2.scrollLeft){
        icefable2.scrollLeft=0;
        icefable2.scrollLeft+=1;
      }
      }

    }-->
    </SCRIPT>
      

  2.   

    问题已经解决了是因为里面多了
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    但不知道为什么会这样。谁能帮我解释一下。