![]() ![]() ![]() Now scrolling the div works just like scrolling the body while body has no scrollbar. Var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight) ĭocument.getElementById('ScrollDiv').style.height = height + 'px' Now all you need to do is to add an onScroll function to the container div and scroll body as the div scrolls. Now inside this div make another div with the height of your document (with all it's contents). This div should be vertically scroll-able. For Apple fans, Safari also offers amazing. Then make a div with fixed position with a height equal to the screen height and make it's width thin to look like scrollbar. It’s also speedy, with the 2021 Jetstream 2 browser benchmark giving it a score of 136, higher than other popular browsers like Chrome and Firefox. I solved a similar problem I had with scrollbar this way:įirst disable vertical scrollbar by setting it's: overflow-y: hidden
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |