简体   繁体   English

jQuery向下滚动弹出窗口页面而不是主要的html页面

[英]jQuery scroll down pop up window page and not the main html page

We have html page with a pop up that gets opened on button click. 我们有一个带有弹出页面的HTML页面,单击该按钮即可打开该页面。 Both html page and pop up have scroll bar for them. html页面和弹出窗口都具有滚动条。

I want pop up window to scroll down on click of a button that is inside the pop up. 我希望弹出窗口在单击弹出窗口中的按钮时向下滚动。

I am doing: $(window).scrollTop($('#suggestDetails').offset().top); 我正在做:$(window).scrollTop($('#suggestDetails')。offset()。top);

The element #suggestDetails is inside the pop up but the main html page scroll bar gets down on button click and not the pop up scroll bar. 元素#suggestDetails在弹出窗口内,但是HTML主页面滚动条在单击按钮时下降,而在弹出滚动条中则下降。

Any idea how to move down scroll bar/screen inside the pop up? 知道如何在弹出窗口中向下滚动滚动条/屏幕吗?

您需要滚动弹出窗口/模式窗口,而不是窗口。

 $('#yourmodal-id').scrollTop($('#suggestDetails').offset().top); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM