2013-05-08 17 views
0

將左邊和上邊的子窗口置於中心位置的正確值是什麼? 我試了左= 500和頂= 500,但窗口現在在頁面的底部。 這裏是代碼:javascript,php - 如何將子窗口放置在中心?

<a href="items.php?desc='.urlencode($row[7]).'"onClick="MM_openBrWindow(\'items.php? desc='.urlencode($row[7]).'\',\'google\',\'width=650,height=500,left=500,top=5\'); return false;"> 
<img src="Folder-Blank-icon.png"></a> 
+0

你爲什麼要發送左/前500?你的代碼片段引用了其他看起來相關的方法和元素,但沒有關於它們的代碼,看看整個事情會很有用。 – 2013-05-08 01:21:39

回答

0
  1. 你應該使用JS
  2. 機頂盒和左PARAMS然後

    文件撰寫用戶的顯示分辨率(screen.width + 'X' +屏幕。高度);

可能無法在舊版瀏覽器中使用,但會在最新版本中使用。

此處瞭解詳情:

http://www.javascriptkit.com/howto/newtech3.shtml

+0

怎麼樣?我是新來的JavaScript。 – user2335183 2013-05-08 01:28:53

+0

@ user2335183 https://www.google.com/search?q=get+user's+display+resolution+using+JS – 2013-05-08 01:31:01

+0

@paulius獲得分辨率後,我如何設置參數? – user2335183 2013-05-08 01:41:01

相關問題