JavaScript functions can be divided into five categories altogether:• General functions• Array functions• Date function• Mathematical Functions• String Functions1. General functionsThe JavaScript general functions include the following 9 functions:(1
The following four functions are part of it.
first we want to add a browser detection script:
Copy Code code as follows:
/************************************
* Detection Browser
***********************************/
var user =
css|js| link | Mouse hyperlink, the general practice is to give a title property, so that the user's mouse hover over the hyperlink, it will show the title of the content. But are you tired of the same mouse hover effect?
Of course, there are also
js| Right button
Some Web pages prohibit the use of the right button and copy function, and even the CTRL key is also prohibited, this effect is how to achieve it? In fact very simple is called a section of JS code just.The following text box is the
Mouse | Right button
First of all, for Internet Explorer to hide the right mouse button method, it can be said that as long as the person who has done the Web page may know to use Document.oncontextmenu=function ("return false;"); For
Sometimes the development of some special effects, they feel very cool, like operating their own computer to operate your Web page, here is a use of bootstrap a little more windows and drag effect bar!
Here, we do not use the static open way, low...
The reference to jquery saves a lot of mouse clicks on the judgment. The interface is obviously a copy of Windows Minesweeper, detailed content in the comments are there, I will not long-winded ~
Let's take a screenshot first ~
Quotes jquery
Add one point:
To prevent the movement of selected text, FF can set CSS
Xxxx{-moz-user-select:none;}
Other browsers can set the
Xxxx.onselectstart = function () {return false}
One principle is to create a placeholder element (or copy a target
Copy Code code as follows:
JScript files:
Detection browser MSIE Firefox
var Ie=false,moz=false;
(Function ()
{//check the browser
var useragent=navigator.useragent;
if (Useragent.indexof ("MSIE")!=-1)
Ie=true;
else if
It has been said that a really good program is no if. Else, of course, switch is not as good as if. Else JS specification inside is prohibit to use switch.
The Command object is the perfect solution to the problem.
Referring to a foreign blog:
Disable the right-click menu of the Web page, but you can still use shortcut keys to copy.
JS code disables the replication feature:
Copy Code code as follows:
Note that this code must be placed behind the body element, in
1. Get the Width,border color of the style sheet CSS (not between rows) is mainly ie6-7 support Currentstyle, standard browser support getComputedStyle;
Instances: Encapsulating functions
Copy Code code as follows:
function GetStyle
Accidentally saw the previous do a simple div drag-and-drop effect, modified a little bit of comment, after testing the perfect through the firefox/chrome/ie6-11, now to share.
First of all, the implementation of the principles and points, the main
Let me just briefly talk about the implementation process:
1. Find the link source, I am here is a string of li under the link
2. Processing style
3. When the mouse moves to load the site of the link source to the specified container, and toggle
Have you ever seen those two things (in the title) being used in JQuery? Here's a simple example:
Copy Code code as follows:
$ ("a"). Click (function () {
$ (' body '). Append ($ (this). attr ("href"));
return false;
}
What is the return false effect in Jquey?In many of the statements have the use of return false, of course, for the developers familiar with it, of course, know the role of this statement, of course, know when to use this statement, but for
1. Prototype chain
Rarely used alone
Copy Code code as follows:
View Code
Defines the superclass class, which has an attribute property and a method Getsupervalue
Function Superclass () {
This.property = true;
}
See this article in blue, feel the author summed up the good, at least some I do not really know. These things really should be summed up, but I this person is lazy, collection of this, easy to learn!
1.firefox cannot support the innertext.
The href attribute of the, tag in HTML is used to specify the URL of the hyperlink's destination. In all browsers, the default appearance of the link is:
Links that are not accessed are underlined and blue the links that have been visited with
This article is mainly on the use of jquery, Live () Methods of detailed analysis of the introduction, the need for friends can come to the reference, hope to help everyone else Add events to jquery's dynamically generated page elements? Use the
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.