日期:2014-05-16  浏览次数:20393 次

JS脚本中onClick没有起作用,大家帮我看看我哪里写错了
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没有起作用,窗口不出来本正确的是弹出一个窗口,请帮我看一下,谢谢……

------解决方案--------------------
自己写错了:
<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>
------解决方案--------------------
改成下面就可以了
<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'>