JavaScript disables the user right-click menu, Copy, select, Ctrl,alt,shift. Get wide Height

Source: Internet
Author: User

//Disabling the right-click menuDocument.oncontextmenu =function() {Event.returnvalue=false;}//Disable SelectionDocument.onselectstart =function() {Event.returnvalue=false;}//Disabling ReplicationDocument.oncopy =function() {Event.returnvalue=false;}//Disable CTRL, ALT, and shift in the keyboardDocument.onkeydown =function(){    if(event.ctrlkey) {return false; }    if(event.altkey) {return false; }    if(event.shiftkey) {return false; }}

Browser width High

var w = document.documentElement.clientWidth | | Document.body.clientWidth; var h = document.documentElement.clientHeight | | Document.body.clientHeight;

Page Body Width height

var w = document.documentElement.scrollWidth | | Document.body.scrollWidth; var h = document.documentElement.scrollHeight | | Document.body.scrollHeight;

The width of the visible area of the Web page, including the Edge of the scrollbar (will change with the window's display size)

var w = document.documentElement.offsetWidth | | Document.body.offsetWidth; var h = document.documentElement.offsetHeight | | Document.body.offsetHeight;

The distance and offset of the page volume

1.scrollLeft: Sets or gets the distance between the left edge of the given object and the leftmost of the currently visible content in the window;

2.scrollTop: Sets or gets the distance between the top of the given object and the leftmost of the currently visible content in the window;

3.offsetLeft: Sets or gets the left position of the calculation at the given object relative to the layout or the parent coordinate specified by the Offsetparent property;

4.offsetTop: Sets or gets the calculated top position of the given object relative to the layout or the parent coordinate specified by the Offsetparent property;

JavaScript disables the user right-click menu, Copy, select, Ctrl,alt,shift. Get wide Height

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.