JS脚本中onClick没有起作用,大家帮我看看我哪里写错了

li16520 2012-08-29 01:24:34
lastScrollY=0;
function heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}

//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("lovexin12").style.top=parseInt(document.getElementById

("lovexin12").style.top)+percent+"px";
document.getElementById("lovexin14").style.top=parseInt(document.getElementById

("lovexin12").style.top)+percent+"px";

lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
suspendcode12="<DIV id=\"lovexin12\" style='left:1px;POSITION:absolute;TOP:200px;'></div>"
suspendcode14="<DIV id=\"lovexin14\" style='right:1px;POSITION:absolute;TOP:200px;'><a href='online_edit.php' onClick='window.open(this.href,,top=50,left=50,width=750,height=576,scrollbars=no,resizable=no);return false;' target='_blank'><img src='../images/main/online_edit.png' WIDTH=56 HEIGHT=305 border=0></img></a><br/></div>"
document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()",1);

这是一个页面上右边漂浮的JS
suspendcode14="<DIV id=\"lovexin14\" style='right:1px;POSITION:absolute;TOP:200px;'><a href='online_edit.php' onClick='window.open(this.href,,top=50,left=50,width=750,height=576,scrollbars=no,resizable=no);return false;' target='_blank'><img src='../images/main/online_edit.png' WIDTH=56 HEIGHT=305 border=0></img></a><br/></div>"
中<a href='online_edit.php' onClick='window.open(this.href,,top=50,left=50,width=750,height=576,scrollbars=no,resizable=no);return false;' target='_blank'>的onClick没有起作用,窗口不出来本正确的是弹出一个窗口,请帮我看一下,谢谢……
...全文
143 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
oggmm 2012-08-31
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]

虽然还是有问题,不过还是谢谢你……引用 3 楼 的回复:

改成下面就可以了
<a onclick='window.open(this.href,"标题自己取","top=50,left=50,width=750,height=576,scrollbars=no,resizable=no");return false;' href='online_edit.php' target='_b……
[/Quote]
改成这样打开是没有问题的 不知道你的问题又是什么问题
li16520 2012-08-31
  • 打赏
  • 举报
回复
虽然还是有问题,不过还是谢谢你……[Quote=引用 3 楼 的回复:]

改成下面就可以了
<a onclick='window.open(this.href,"标题自己取","top=50,left=50,width=750,height=576,scrollbars=no,resizable=no");return false;' href='online_edit.php' target='_blank'>
[/Quote]
li16520 2012-08-29
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

[/Quote]有错误提示,不行的啊
pxxaish9527 2012-08-29
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

自己写错了:
<a href='online_edit.php' onclick='window.open(this.href,"","top=50,left=50,width=750,height=576,scrollbars=no,resizable=no");return false' target='_blank'>bd</a>
[/Quote]
顶!!!
oggmm 2012-08-29
  • 打赏
  • 举报
回复
改成下面就可以了
<a onclick='window.open(this.href,"标题自己取","top=50,left=50,width=750,height=576,scrollbars=no,resizable=no");return false;' href='online_edit.php' target='_blank'>
蓝色小棉袄 2012-08-29
  • 打赏
  • 举报
回复
未知数 2012-08-29
  • 打赏
  • 举报
回复
自己写错了:
<a href='online_edit.php' onclick='window.open(this.href,"","top=50,left=50,width=750,height=576,scrollbars=no,resizable=no");return false' target='_blank'>bd</a>

87,991

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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