This article mainly summarizes several common methods for disabling right-click and mouse drag on the webpage. It is very practical and can be used as a reference by a small partner.
1. Right-click prohibited menu:
There are two ways to disable
This article mainly summarizes several common methods for disabling right-click and mouse drag on the webpage. it is very practical and can be used as a reference by a small partner.
1. right-click prohibited menu:
There are two ways to disable
Disable the right mouse button menu bar
$("body").bind("contextmenu", function(event) { return false; });
Disable shortcut keys
Select AllCopyput it in your notes .$("Body"). Bind ("KeyDown", function (e) {E=window.event| | EMask F5 Refresh KeyIfevent.keycode==(e.keycode) {=0;You need to set the KeyCode to false under IEReturnFalse }Masking ALT
When you want to save beautiful pictures or wonderful texts on a webpage, you usually select the target and right-click it, select "Save image as" or "copy" in the pop-up menu to achieve our goal. However, many web pages are currently blocked by right-clicking. As a result, a window will pop up when we press the right-
)) {return
false;
}
});
3. Disable right-click functionthe code is as follows:
$ (document). Ready (function () {
$ (document). Bind ("ContextMenu", function (e) {
alert ("sorry! No right-clicking! ");
return false;
});
4, jquery to prevent the BACKSPACE key page back to the im
As we all know, the general method of shielding is to use JS to write scripts, but can also be directly modified by the method of page properties to block right-click Prohibit replication.Disable Right-clickOncontextmenu= "return False"Prohibit copying and clipping:Oncopy= "return false;"Oncut= "return false;"Prohibit copyingOnselectstart= "return False"
Disable Web page Right-click menu and mouse drag selected statementFirst, disable the right mouse button menu:There are two ways to disable the right mouse button1. Add the
First, prohibit the right mouse button menu: There are two ways to suppress the right mouse button 1, the HTML element in the body tag to add JavaScript event handle, the code is as follows:oncontextmenu= "return false">Note: You can also disable the right button in the loca
One, the right mouse button is prohibited menu:
There are two ways to disable the right mouse button
1, add the JavaScript event handle in the body tag of the HTML element, the code is as follows:
Copy Code code as follows:
Note: You can also prohibit the
JS code disables the replication feature:
Copy Code code as follows:
Note that this code must be placed behind the body element, in front or in the head without any effect.
Complement: Document.body.onselectstart page check function.
Document.body.oncontextmenu page Right menu.
Document.body.ondragstart page content drag and drop function, drag can be achieved replication. You need to disa
Many people will encounter this situation, when browsing the page, found that the right mouse button is not enabled. Hey? Refresh and refresh, and no eggs, and then hit the mouse (yes, I was so violent), change the browser, useless, and finally abandoned. In fact, this is because the designer has enabled the "Disable Right button" feature on the page in order to
This article mainly introduces jquery disable right-click function Mask F5 refresh the specific implementation, need friends can refer to the next1. Disable right-click function code as follows: $ (document). Ready (function () {$
This article mainly introduces jQuery shortcut methods such as disabling keyboard rewind, shielding F5 refresh, and disabling right-click, if you are interested, refer to the examples in this article to introduce four methods for jquery to disable multiple functions.
1. disable F5 to refresh jQuery instance codeF5 ha
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.