如何在Onchange事件后保持页面滚动位置

时间:2014-05-18 20:39:32

标签: scroll onchange

我在下拉列表中使用onchange事件来更新数据库,然后返回到同一页面以显示此更改。

我需要的是页面保持滚动位置而不是用户向下滚动页面到用户工作的位置。

这是onchange <select>标记

<option value=''>--Please Select</option>
    <!-- Lots of code not pasted here -->           
</option>

这是正在执行的功能

function updatePO(poID, trackerID) {
        //this function will add the PO/Vendor chosen from the drop down list on each individual tracker item on the fly
        window.location="https://www.webpage.php?poID="+poID+"&trackerID="+trackerID;
}

我已尝试过这些链接中的各种方法,但仍然无法将它们与我的功能结合使用...提前致谢。

How to maintain page scroll position after a jquery event is carried out?

http://mrcoles.com/blog/scroll-sneak-maintain-position-between-page-loads/

Refresh Page and Keep Scroll Position

0 个答案:

没有答案