Firefox uses Dommousescroll, and other browsers use MouseWheel. When scrolling event triggers Firefox uses the Detail property to capture wheel information, and other browsers use Wheeldelta. I don't know why other vendors and Microsoft are so
JavaScript is a very flexible language, and the This keyword is flexible, but because of its flexibility, it is doomed to be difficult to use.
I used this when I would feel uneasy, always worried that it does not know how to point to another place.
The code is as follows
Copy Code
ShowTime ();function ShowTime (){var today = new Date ();Alert ("The time is:" + today.tostring ());SetTimeout ("ShowTime ()", 5000);}
Once this function is called, the time is displayed
Array definitionWe use the keyword new to create an array object. The following code defines an array object named MyArray:
The Var myarray=new array () has two methods of assigning values to an array (you can add as many values as you want, as you
var statementdeclare a variable.
var variable1 [= value1] [, variable2 [= value2], ...]
ParametersVariable, variable2
The name of the variable being declared.
Value, value2
The initialization value assigned to the variable.
DescriptionUse the
Web effects useragent Get user Browser type
var useragent = navigator.userAgent.toLowerCase ();
useragent property syntaxNavigator.useragent;UserAgent Property Description
Attribute descriptionappCodeName Gets the code name of the browser.
If there are spaces or other delimiters in the string, you can split the Split method, return an array, and
The number of years in the array is passed as a parameter to the new date () to generate the date type;If there is no special separator, you
Web page special effects array [] {} array operation detailed
JS does not have an array of character indices except numbersOf course! Can do that when the results are not what you thinkSuch as:var p = new Array ();
P[0] = ' first value ';
P[1] = '
Try...catch can test errors in your code. The try section contains the code that needs to be run, and the catch part contains the code that runs when the error occurs.There are two ways to catch errors in a Web page:Use the Try...catch statement.
Function and Object
var n = new Number (1)N.prototype-> undefinedWhy N.prototype for undefined? I was puzzled by the problem. Because we know that the new function (). Prototype is object. This issue raises my interest in function and object
First look at the effect of the picture:
JavaScript Password Strength Check code, the specific implementation of the idea is not much to say, please see the following code and demo.
The first method:
* * Password security
*return:
The "A>b" in mathematics is also expressed in JavaScript as a>b; "B is greater than a, a, or less than C" is a "aa && ba| | A>b;//b>a is True,a>b is False,c is a true logical OR operator value table: a b a| | B True True (True) True (True) True
Now, say the judgment statement (IF)The IF statement is the statement that is used when the code is executed based on the condition.Grammar:if (condition){Execute code when condition is set}Note: If lowercase, uppercase letters (IF) will go
From the beginning of C language sometimes to tell some details or the bottom of things, I like to use C language, because C more convenient to describe the memory of things. To give an example, the swap function, I believe that some programming
DIV + CSS and divcssDIV + CSSBytesDIV + CSS "is actually an inaccurate nameBefore taking notes, you must correct a mistake,It is actually an inaccurate method of calling "DIV + CSS ".It is the name given by Chinese people to this standard page
JavaScript achieves the big picture carousel effect, and javascript implements the big picture
Examples of this article share the code for js image carousel effect for your reference. The details are as follows:
big picture carousel > 1
Native js achieves seamless Horizontal Rolling and js horizontal seamless
Seamless horizontal scrolling
Supports image and text scrolling.Principle:A large box contains two boxes, which are implemented by setting the offsetWidth and scrollLeft
Tip: you can modify some code before running JS Open layer/close layer/move layer animation effect-[Open layer] [close layer] Mobile layer Tip: you can modify some code before running
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