[求助]为什么两侧的浮动窗口不能移动

flamelp 2006-04-28 02:38:37
最近做了个网站,快五一了要在上面挂两个庆祝标语,写的代码在一个页面上两边的漂浮窗口可以随下拉列表移动,另一个页面却移不动,这是为什么??那位能帮帮我。
下面是代码 不过我想代码应该不会有什么问题,因为两个页面用的是同一个代码和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()
}
...全文
355 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
kokubo_wing 2006-04-28
  • 打赏
  • 举报
回复
解决了,替LZ高兴
flamelp 2006-04-28
  • 打赏
  • 举报
回复
问题已经解决了是因为里面多了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
但不知道为什么会这样。谁能帮我解释一下。
webwait 2006-04-28
  • 打赏
  • 举报
回复
太长了,看着都晕,你单步测试一下
flamelp 2006-04-28
  • 打赏
  • 举报
回复
左下角没有错误的显示,两个页面中有这个代码是用来图片移动的
<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>
webwait 2006-04-28
  • 打赏
  • 举报
回复
既然js没什么问题,就比较一下两个页面有什么不同
xxuu503 2006-04-28
  • 打赏
  • 举报
回复
看不移动的那个页面的左下角,状态栏,双击

把错误给报出来
flamelp 2006-04-28
  • 打赏
  • 举报
回复
问题比较急,自己顶一下。

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧