Presuming the simplified HTML code is:
<html><body><div class=wrap>content...</div></body></html>
Set both body, html to height:100%;
body, html {height:100%;}
Put a div inside body, and set it to stretch across all the body height:
div.wrap {height:100%; overflow:hidden;}
This will prevent window from scrolling in weird ways, like, pressing mouse wheel and moving it, using anchors, etc.
To remove the scroll bar itself (visually), you should also add:
body {overflow: hidden; }
To disable scrolling via pressing arrow keys on keyboard:
window.addEventListener("keydown", function(e) { // space, page up, page down and arrow keys: if([32, 33, 34, 37, 38, 39, 40].indexOf(e.keyCode) > -1) { e.preventDefault(); } }, false);
Related Posts:
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Failed to load resource: the server responded with a status of 404 (Not Found)
- How can I scroll to an element using jQuery?
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- Bootstrap Dropdown menu is not working
- Change Background color (css property) using Jquery
- Set timeout for ajax (jQuery)
- How does the data-toggle attribute work? (What’s its API?)
- CSS height 100% percent not working
- Use images like checkboxes
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Full-screen iframe with a height of 100%
- How to print HTML content on click of a button, but not the page?
- Bootstrap 4 Dropdown Menu not working?
- Why is the jquery script not working?
- Textarea Auto height
- Why is marquee deprecated and what is the best alternative?
- Refresh/reload the content in Div using jquery/ajax
- How to write inside a DIV box with javascript
- How to get height of div in px dimension
- Crop the image using JavaScript
- Force div to be topmost element of any and all webpages
- Retrieve the position (X,Y) of an HTML element
- How to display raw JSON data on a HTML page
- how to display a div triggered by onclick event
- Why is jquery show() not working in example
- jQuery scrollTop() method not working
- Change an image with onclick()
- JavaScript – Count Number of Visitor for Website
- Creating Accordion Table with Bootstrap
- Fully responsive HTML5 video
- How to create checkbox inside dropdown?
- Positioning element at center of screen
- Adding Google Translate to a web site
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- How to make HTML element resizable using pure Javascript?
- How to use aria-expanded=”true” to change a css property
- How to set “style=display:none;” using jQuery’s attr method?
- WordPress Bootstrap Handburger Menu Wont Open
- Hide CSS class only in single post pages
- How to fix “Cannot read property ‘addEventListener’ of null” error [duplicate]
- Remove class using jQuery
- How do I check whether a checkbox is checked in jQuery?
- How to make a word underline in Markdown
- How to play audio?
- How to play audio?
- Include another HTML file in a HTML file
- How to add jQuery code into HTML Page
- “Uncaught TypeError: Cannot read property ‘style’ of null at.. “
- jquery SlideToggle effect in upward direction?
- HTML5 Local storage vs. Session storage
- Programmatically change the src of an img tag
- Setting background-image using jQuery CSS property
- Error: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’
- How can I select an element by name with jQuery?
- jQuery disable/enable submit button
- TypeError: $(…).modal is not a function with bootstrap Modal
- How to do fade-in and fade-out with JavaScript and CSS
- Vue is not defined
- OnChange event handler for radio button (INPUT type=”radio”) doesn’t work as one value
- onClick to get the ID of the clicked button
- HTML text input allow only numeric input
- How to change the buttons text using javascript
- How do I use this JavaScript variable in HTML?
- How to close current tab in a browser window?
- jQuery: Uncaught Error: Syntax error, unrecognized expression
- SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
- How to use in jQuery :not and hasClass() to get a specific element without a class
- Adjust width and height of iframe to fit with content in it
- HTML onchange (this.value)
- How to make an HTML back link?
- How to fix getImageData() error The canvas has been tainted by cross-origin data?
- How do I load an HTML page in a div using JavaScript?
- ReactJS – .JS vs .JSX
- How to implement “select all” check box in HTML?
- How to embed a youtube playlist with a sidebar
- External JavaScript Not Running, does not write to document
- JavaScript button onclick not working
- Create a simple 10 second countdown
- Get the size of the screen, current web page and browser window
- How to enable a disabled checkbox dynamically?
- When is a CDATA section necessary within a script tag?
- How to change cursor from pointer to finger using jQuery?
- How to wrap the content of the main tinyMCE editor with extra tags
- Minify HTML, CSS, JS with PHPWee?
- How do developers add “Smooth Transitions” to their sites?
- Building a slide down search box in wordpress
- How can I get the search form to be selected automatically?
- WP adds long version query strings to CSS and JS files
- creating a static HTML/JS/PHP page
- Web cover page open when button clicked
- How to run Javascript popup modal in a loop?
- Landing Page with HTML CSS JS and Images on wordpress
- How to make wocommerce shop products same heigt
- Where to find the html for WordPress site? [closed]
- Import HTML code that loads css and javascript into specific page
- How to keep close a sub-menu under homepage? [closed]
- Interactive maps in wordpress
- Sending GravityForms to custom HTML