简体   繁体   中英

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. Both html page and pop up have scroll bar for them.

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);

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.

Any idea how to move down scroll bar/screen inside the pop up?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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