Today, I saw a rose drawn using JavaScript on the Internet. I have cut off its steps for you to share.
3D rose implementationCodeAs follows:
With (M = math) C = cos, S = sin, P = pow, r = random; C. width = C. Height = f = 500; H =-250;
Click the place display layer of the mouse on the webpage to select a location and display the selected location in the text box. It mainly displays and hides the control layer.
hide and show exercises on the layer
& nbsp; & nbsp; location: &
Let's start with a simple example. A simple button control is as follows:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
Then register the event for it. In this case, how can we get the event in
Defines the circle class, and has the member variable R, constant Pi, and calculated area member function area ()
JavaScript code// 1st writing methods
Function circle (r ){
This. r = R;
}
Circle. Pi = 3.14159;
Circle. Prototype. Area = function (){
General events
Event
Browser support
Description
Onclick
Ie3 | N2 | O3
Click an event.
Ondblclick
Ie4 | N4 | o
Double-click event
Onmousedown
Ie4 | N4 | o
The button on the mouse is
Sometimes we see some large websites. If there are many images on the page, When you scroll to the corresponding row, the current row of images will be loaded instantly, in this way, only images in the visible area are displayed on the page, while
1. +
(1) indicates a string connection. If a string exists in an expression, operations are performed based on the string connection first (native JavaScript)
(2) indicates the positive unary operator of a number. For example, + 5 is an expression,
In many languages, "events" are difficult to understand, but they are also a very important concept. The same is true for event processing in Javascript. It is precisely because of event processing that AJAX dragging will occur. This article will
The colon has three syntax functions: (1) declaring the members and declaration labels of a direct object
(2) switch statement Branch
(3 )? : False of a ternary expression
The landlord's code is the first application
JScript code
A little research on obtaining the visible window size of various browsers.
In my local test:It can be used in IE, Firefox, and operaDocument. Body. clientwidthDocument. Body. clientheightIt is very simple and convenient.In the company's
ThisIn JavaScript, this usually points to the function we are executing, or to the object to which the function belongs (runtime ). When we define the function dosomething () in the page, its owner is the page, or the window object (or Global Object)
1. Direct function call method:
Insert the following code before the body tag
Parameter description: window. open is the command to open a new window. The parameter URL is used to input the page to be opened;
Newwindow is optional;
Height indicates
/*
* This function executes the Copy command.
*/
Function fn_doufucopy (){
Edit. Select ();
Document.exe ccommand ('copy ');
}
/*
* This function executes the paste command.
*/
Function fn_doufupaste (){
TT. Focus ();
Document.exe
When you open a new page through showmodeldialog on a common page, you can use showmodeldialog to open another page on this new page. Under IE6, you can find that you can operate the original normal page.
The procedure is as follows:
Page1.show (){
A colon generally has three syntax functions:
(1) declaring members and declaring tags of a direct object(2) switch statement Branch(3 )? : False of a ternary expression
Code highlighting produced by Actipro CodeHighlighter
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