This is a display effect similar to the Apple slide.In addition to the original effect (including slow click and slide, drag and slide ),ProgramThe scroll wheel and keyboard control are unique. The mouse on both sides of the slide will automatically
When I used to write JavaScript scripts, all events used
Object. event = handler; . This method is common for Internet Explorer, Mozilla/Firefox, and opera. However, one problem is that this method only corresponds to one event processing process.
Table 3-1. Special numeric Constants
Constant
Meaning
Infinity
Special value to represent infinity
Nan
Special not-a-number value
Number. max_value
Largest representable number
This Javascript is used to enter the number of dessert circles (two types: Cake and glaze), the price is dounutprice, the script automatically calculates the order price based on user input, and finally click Submit. Download the script source code
I. JavaScript Functions
Function Definition Syntax:
Function function_name (var1, var2 ...){
...
[Return value]
}
Var1 and var2 are independent variable parameters. If a function returns a value, use the return statement.
Ii. Page element event
I haven't written anything for a long time. It may be that people are getting lazy. I always put off my work on excuses!
Recently I was working on a small BS project. I remember that when I was engaged in Asp.net, I was a little impressed with most
Today, my colleague a Cong needs to implement a function to replace the variables in an arithmetic formula. I will help you think about it and write the following method to test it, as if OK.
Anonymous Functions
You can also define a variable by assigning it to an anonymous function.
Example D2
Code:VaR add = function (a, B){Return A + B;}Alert (add (1, 2); // result 3
This code is the same as the previous example. Maybe the syntax
Function: Object
A function is a special form of Object in JavaScript. It is the first [B] class data type ). This means that we can add attributes to it. Here are some interesting points to note:
Object Creation
As mentioned earlier, when we define
Which function is called?
You may be thinking about naming conflicts. For example, which of the following functions is called calculate?
Example 8
Code:
Function calculate (number){Return number/3;}
Function gethalfof (num1, num2, num3){Function
Pointer pointing
We can re-allocate a function after it is created, but we need to point to the function object rather than its pointer. In the following example, I will change the content of myfunction.
Example 6:
Code:Function myfunction (){Alert
Add attribute
When we use the keyword new to create an object as above, a new object is created. We can add attributes to this object after the object is created (as if I have added the attribute name as above. The next problem is that if we create
Use functions as attributes
Any type of object can be used as an attribute. Recall the previous example 4 (not example dt4), and the function is also an object. Therefore, you can use a function as an attribute of an object. Next, I will add two
The boolean type in javascrip is very interesting, at least from the perspective of the strong type language C;
First, to determine whether it is true or false, not only to use True or false, as if any object can be used as a Boolean judgment, is
It took a long time to get started with JavaScript, but it was not known until recently that there was also an error capture mechanism in Javascript, which is very similar to. Net:
Try
{
// Code
}
Catch (E)
{
Alert (E. descriptioon );
}
I am reading the Javascript authoritative guide, sorting out some notes, and urging myself to learn it. I hope I can stick to it every day.
Comparison: JavaScript and jquery are used to determine whether an element exists. If not, a child element
When creating a website background, a function referenced by the webpage to delete a product is in IE6, and IE7 cannot be executed. IE6 IE7 of dog blood does not have a console like chrome, so debugging is very troublesome. It only gives an
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