Div Scrolling Freezes Sometimes If I Use -Webkit-Overflow-Scrolling

jQuery scroll to top freezing if called mid-scroll

Why you can not see the div when is display. When the event is called in the middle of the scrolling the scroll bar hidden and the div apper at the top of your page, but your viewport is not at the top position. If you set the div CSS position property to fixed it will work, css position. the fixed value of the position property is relative to the viewport.

So the problem is not on your jquery code.

code here

plunker

And check this:

  • Scrolls to the top of the screen.

  • Once users complete the action it will remove the class and hide the div so they can continue scrolling.

I think it will be best if they can continue at the position the wear before.

Screen scrolling getting stuck for React / Material UI

try the following:

html,
body {
width: 100%;
margin: 0;
padding: 0;
}

in your app.css or a global stylesheet. I know I've run into this issue a couple of times with material ui

Prevent scrolling of parent element when inner element scroll position reaches top/bottom?

It's possible with the use of Brandon Aaron's Mousewheel plugin.

Here's a demo: http://jsbin.com/jivutakama/edit?html,js,output

$(function() {

var toolbox = $('#toolbox'),
height = toolbox.height(),
scrollHeight = toolbox.get(0).scrollHeight;

toolbox.bind('mousewheel', function(e, d) {
if((this.scrollTop === (scrollHeight - height) && d < 0) || (this.scrollTop === 0 && d > 0)) {
e.preventDefault();
}
});

});

ScrollIntoView() causing the whole page to move

You could use scrollTop instead of scrollIntoView():

var target = document.getElementById("target");
target.parentNode.scrollTop = target.offsetTop;

jsFiddle: http://jsfiddle.net/LEqjm/

If there's more than one scrollable element that you want to scroll, you'll need to change the scrollTop of each one individually, based on the offsetTops of the intervening elements. This should give you the fine-grained control to avoid the problem you're having.

EDIT: offsetTop isn't necessarily relative to the parent element - it's relative to the first positioned ancestor. If the parent element isn't positioned (relative, absolute or fixed), you may need to change the second line to:

target.parentNode.scrollTop = target.offsetTop - target.parentNode.offsetTop;

How to freeze header of the page

Try using the position: fixed; property. Here is an example fiddle:
http://jsfiddle.net/austinbv/2KTFG/



Related Topics



Leave a reply



Submit