Disable Scrolling on Body
Set height
and overflow
:
html, body {margin: 0; height: 100%; overflow: hidden}
http://jsfiddle.net/q99hvawt/
scrolling disabled in the webpage when full screen mode is triggered
Change el
to document.documentElement
and the scrolling will work in Firefox.
var el = document.documentElement;
It will break in JSFiddle while using Chrome(because of iframe policies I guess), but I don't think that's the main use.
Bootstrap: Prevent Scrolling in LG or larger, Enable Scrolling in MD or smaller
Instead of using h-100
I would use min-vh-100
on the "pages", and then you only need to have a @media query for the body overflow (no JS needed):
@media (min-width: 576px) {
body {
overflow: hidden;
}
}
https://codeply.com/p/dfIMHaQwV1
Related Topics
Stretch Height to Fit Content in React Native
Using Thymeleaf Variable in Onclick Attribute
Concatenate Json to a String in JavaScript
Image Taken from Camera Not Saved to Gallery
Onclick JavaScript to Make Browser Go Back to Previous Page
Jquery Validate Phone Number With With Regex
Pass Input Tag Value to as Href Parameter
Multiple Key Names, Same Pair Value
Show/Hide Select Options Based on Value of Another Select Using Javascript/Jquery
Save Image File from Image Url JavaScript HTML
Save State When Refresh Page - Reactjs
Angular 4: How to Read Content of Text File With Httpclient
How to Set Image to Fit Width of the Page Using Jspdf
How to Replace Double/Multiple Slash to Single in Url
How to Show Roles of User Discord.Js/Userinfo Command
How to Find Object in a List of Items by Index Using Es6 (Reactjs)