我使用的是一個windows.open彈出窗口,當我點擊它時頁面自動上升,我該如何防止這種情況?我想 '頂:汽車' 它沒有在這裏工作是我的代碼window.open使頁面向上滾動
function openPopup() { var divText = document.getElementById("pass").outerHTML; var myWindow = window.open('', '', 'width=500,height=200,top=100'); var doc = myWindow.document; doc.open(); doc.write(divText); doc.close(); }
<a href="#" onclick="openPopup()">Read More</a>
的[維持在Javascript窗口滾動位置可能重複。打開()](http://stackoverflow.com/questions/372907/maintain-scroll-position-in-javascript-window-open) – j08691