window.open弹出页面后,父页面上移
用下面语句来弹出新的页面,父页面就会出现整体上移的情况,
<a href='#' onclick=window.open('../news/newsview.php?id=".$r['id']."','','scrollbars=yes,resizable=no,width=760,height=500')>".substring($r['title'],52)."</a>";
 
好像还不能控制弹出页面的大小,请遇到这样问题的朋友给点建议,谢谢!

解决方案 »

  1.   

    <a   href= '#aaa'   onclick=window.open( '../news/newsview.php?id= ".$r[ 'id ']. " ', ' ', 'scrollbars=yes,resizable=no,width=760,height=500 ')> ".substring($r[ 'title '],52). " </a> "; <a name="aaa"></a>  放个锚点,在你的代码后面。
      

  2.   

    两种方法
    方法一:
    <a href='javascript:void(0);' onclick=window.open('../news/newsview.php?id=".$r['id']."','','scrollbars=yes,resizable=no,width=760,height=500')>".substring($r['title'],52)." </a>";
    方法二:
    <a href='javascript:window.open('../news/newsview.php?id=".$r['id']."','','scrollbars=yes,resizable=no,width=760,height=500')>".substring($r['title'],52)." </a>";
      

  3.   

    再给一个,一个套路<span style=cursor:hand onclick='javascript:window.open('../news/newsview.php?id=".$r['id']."','','scrollbars=yes,resizable=no,width=760,height=500')>'>".substring($r['title'],52)." </span>
      

  4.   

    用span不用<a href<span style='cursor:pointer;' onclick="window.open('vote.php?id=1','','width=600,heigth=200,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=150,left=200')">查看结果</span>