开发者

Div Overflow, Scroll only work there, till div is removed and trigger a offset of that overflow offsetheight div

开发者 https://www.devze.com 2023-04-11 01:48 出处:网络
I have a Div Overflow prepended to the body container wrapper, when its triggered this prepend, I wish all the scroll made by the mouse scroll work only in the div overflow which has width: 60% of the

I have a Div Overflow prepended to the body container wrapper, when its triggered this prepend, I wish all the scroll made by the mouse scroll work only in the div overflow which has width: 60% of the window. so I wish anywhere I scroll only work in the div overflow, because the way that it is right now, when you reach the maximum scroll in the div, it starts to scroll the body in the background and also if I put my mouse outside of the div overflow it also scrolls the body in the background. what do I do to help this? I'm using JQuery library.

Another thing is that I would like to add an eventListener when the scroll of that div reach some height, it does s开发者_运维知识库omething, call a javascript function for example.

Is it all possible? if Yes, how? Thank you guys in advance.


Try adding overflow:hidden to body. The browser will automatically add scroll if its content reachees beyond its boundaries.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号