Let's talk about one of the most common ideas:
Pack the pictures with UL and set float. Then set the UL as absolute positioning, and its parent tag is located using relative. You can set the left or top values of UL to scroll the image queue.
An anonymous function is a function without a name. For example:
CopyCodeThe Code is as follows: function (){
Alert ('a function ');
}
However, the above Code will report an error. Firebug prompt: function statement requires a name, that is, the
Let me write a few for you to see.
1. Click the parameter passing method.
Copy codeThe Code is as follows:
1
2
3
4
111111
222222
333333
444444
Let me explainVar list = document. getElementById ("list"). getElementsByTagName
If the DOM element does not have a style, the operation will not be performed. 2. We can also use JS to dynamically write DOM elements to html.
Today, we will talk about these two applications.
(1) operate on existing DOM elements in html.
As I
Preface
At present, in software development, unit testing is increasingly valued by developers. It can improve the efficiency of software development and ensure the quality of development. In the past, unit tests were often used in server
The concept of scope in JS:
It indicates the region where variables or functions work. It refers to the context in which they are executed, that is, the context execution environment. There are only two types of Javascript scopes: global and local
Http://www.cnblogs.com/TomXu/archive/2012/02/16/2351331.html, come back to read this article, you will have a deeper understanding. This is because I have introduced few concepts here. Looking at the example below, it may be difficult for beginners!
Javascript: Operator
In fact, if you have a computer language foundation, you should know that operators may even be more proficient than me. In this way, I will not explain them much. Let's talk about other unfamiliar operators!
1. in OPERATOR:
To judge whether it is to select two or more options. For example, if I go to a branch road in front of my house, as long as I know which road is right for the first time, I don't have to think about it any more next time or in the future, take that
The only difference between the first two is that the order of loop and judgment is different. do-while is more than while, and I will not give an example.For loop I believe everyone is familiar with it, so let's look at the for-in sentence.This is
The current version is changed back to v6. The back-end data can be conveniently viewed and debugged only with @ frontend. Yesterday, I also discussed the necessity with a TX front-end engineer. Obtain the variables to be filled in the template and
A colleague has been asking me about Javascript object-oriented things these two days. So, just write an article and let him see it, this article mainly aims to introduce Javascript object-oriented programming from a holistic perspective. (The
Copy codeThe Code is as follows: function class name (parameter table ){
This. Attribute;
......
This. function;
}
In this way, both functions and data members are implemented using "this.Let's define a simple class student, and then construct it
The code in build. js calls the UglifyJS interface function to execute the compression task.
1. Go to github to download the latest UglifyJS. Two download Methods: If git is installed, go to the git console and use the following commandGit clone
Recently, I was looking at the loose coupling and customizable open-source framework of Baidu, tangram. js, which suddenly focused on a way to get the number of milliseconds:
(+ New Date ())
In fact, there is nothing about this writing method, that
As follows:
Copy codeThe Code is as follows: function Person (name, age ){
This. name = name;
This. age = age;
}
Var p = new Person ('lily', 20 );
It is strange to find that the method of creating a regular object in some library code does not
If statement
Syntax:
Copy codeThe Code is as follows: if (condition ){
Statement1;
}
Else {
Statement2;
}
Iteration statement1. do-while statementSyntax:Copy codeThe Code is as follows: do {Statement} While (expression );
2. while
2.9.5. Addition Operators
Addition operators (plus signs and minus signs) are usually the simplest operators. However, in ECMAScript, each addition operator has many special behaviors.
1. Addition operators:Copy codeCode: var iResult = 1 +
2.6 Original Type
ECMAScript has five primitive types: Undefined, Null, Boolean, Number, and String. ECMAScript provides typeof to determine the value type.
1. typeof OPERATOR:
Copy codeThe Code is as follows: var sTemp = "test string ";
Alert
2.7 type conversion
1. convert to a string
All objects can be converted to strings using the toString () method. Note that the toString () method of the Number type has two modes: default mode and base mode, the default toString () method is used to
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