我有一個包含iframe頁面(iframe.aspx)的父頁面(default.aspx)... jQuery動畫滾動在iframe.aspx中完美工作,而不是在父頁面中工作(默認。 ASPX)。iframe中動畫滾動不工作
iframe.aspx頁:
<input type="button" onclick="scollWin();" value="Scroll up" />
<div id="scrollToHere">
Scroll to here
</div>
<script type="javascript">
function scrollWin(){
$('html,body').animate({
scrollTop: $("#scrollToHere").offset().top
}, 2000);
}
</script>
工作:當我按一下按鈕,滾動窗口工作順利進行,並轉到div
。
父頁面(Default.aspx的):
<iframe id="iframebody" runat="server" src="iframe.aspx" style="width:900px;height:600px"></iframe>
當我運行Default.aspx頁,然後點擊按鈕,滾動不工作。
你能告訴我如何訪問父滾動窗口?
@sagivo - >當我點擊,父頁(Default.aspx的)滾動不工作,, – Zeeju 2012-07-31 11:03:36
Sagivo按鈕 - > FRD我沒有得到任何錯誤,我的概率向下滾動不起作用,,,該功能在iframe.aspx頁面中工作,不在default.aspx中請參考此[鏈接](http://blog.freelancer-id.com/2009/03/26/scroll-window - 滑稽的jquery /) – Zeeju 2012-07-31 11:09:24