JS Basic usage 1

Source: Internet
Author: User
Tags joins

The click () object. Click () causes the object to be clicked.
Closed object. Closed Object window is closed True/false
Cleartimeout (object) clears the SetTimeout object that has been set
Clearinterval (object) clears the SetInterval object that has been set
Confirm ("hint message") pops up the confirmation box and concludes that the return is true void return false
Cursor: Style change mouse style hand crosshair text wait help default auto E/s/w/n-resize
Event.clientx returns the x-coordinate value of the last mouse click;
Event.clienty returns the last mouse-click y-coordinate value;
EVENT.OFFSETX returns the current mouse hover x coordinate value
Event.offsety returns the current mouse-hover y-coordinate value
document.write (document.lastmodified) page last updated
Document.ondblclick=x when you double-click the mouse to make an alarm transaction
DOCUMENT.ONMOUSEDOWN=X Click the mouse button to make an alarm transaction
Document.body.scrollTop; Returns and sets the coordinate value of the current vertical migration transition bar, which must be combined with the function,
Document.body.scrollLeft; Returns and sets the coordinate value of the current lateral migration transformation, which must be combined with the function,
Document.title document.title= "message"; Title bar text for current window
Document.bgcolor document.bgcolor= "color value"; Change window patron Color
Document. Fgcolor document. fgcolor= "color value"; Change the color of the body
Document.linkcolor document.linkcolor= "color value"; Change the color of the hyper join
Document.alinkcolor document.alinkcolor= "color value"; Change the color of the right-click Join
Document. Vlinkcolor document. vlinkcolor= "color value"; Change the colors of the received joins
Document.forms.length returns the current page form singular
Document.anchors.length returns the number of anchor in the current page
Document.links.length returns the number of current page joins
Document.onmousedown=x Click the mouse to trigger the transaction
Document.ondblclick=x double-click the mouse to trigger the transaction
Defaultstatus Window.status=defaultstatus; Display the status bar settings by default
function function xx () {...} defining functions
IsNumeric determines if it is a number
InnerHTML xx= object. InnerHTML Enter the HTML source code in an OBJECT tag
InnerText Divid.innertext=xx will set the object value named with the div to XX
Location.reload (); To refresh the page, target can be a refreshed Web page
Math.random () random number, can only be 0 to 1 of the number, if you want to obtain other numbers, can be considered *10, and then rounding
Math.floor (number) Converts an object number to an integer, rounding all decimals
Math.min back to which small
Math.max back to which big
Navigator.appname returns the current browser name
Navigator.appversion returns the current browser version number
Navigator.appcodename returns the current browser code name
Navigator.useragent returns the current browser user token
OnSubmit onsubmit= "return (XX ())" Apply function return value
Opener Opener.document. Object grasping the original open form object
Prompt Xx=window.prompt ("Prompt Information", "predetermined value"); Input statement
Parent parent. Frame name. Object Grasp Frame Page
Return return false Returns value
Random parameters (between 0 and 1)
Reset () Form.reset (); Reset the data in form form
Split ("") String.Split ("") separates string object Word utilises comma
Submit () Form object. Submit () Make the form object commit data
The CharAt (x) object of the String object returns the letter of the dash-bit of the specified object
LastIndexOf ("string") right-to-left polling for the specified character, no return-1
IndexOf ("string") is consulted from left to right for the specified character, no return-1
lowercase () Convert all objects to lowercase
Uppercase () Convert all objects to uppercase
SUBSTRING (0,5) string.substring (x,x) returns the characters from 0 to 5 in the object
SetTimeout ("function", time) sets a timeout object
SetInterval ("function", time) sets a timeout object
toLocaleString () x.tolocalestring () is present in string form when retrieved from X-time object
typeof (variable name) The type of the check variable, the value is: string,boolean,object,function,underfined


Window.event.button==1/2/3 The left mouse button is 1 right button is 22 keys all the way to 3
Window.screen.availWidth return the current screen width (white space)
Window.screen.availHeight returns the current screen height (white space)
Window.screen.width returns the current screen width (discernment value)
Window.screen.height Returns the current screen height (discrimination value)
Window.document.body.offsetHeight; Returns the current page height
Window.document.body.offsetWidth; Returns the current page width
Window.resizeto (0,0) Set the window width height
window.moveto (0,0) to move the window to a status
Window.focus () to get the core
Window.Scroll (x, y) of the current window The window migrates the transition bar coordinates, y grasps the high and low movement, must with the function common
window.open () window.open ("Address", "name", "property")
Property: Toolbar (object bar), location (address bar), Directions,status (status bar),
MenuBar (menu bar), scrollbar (Migration transition bar), resizable (change size), Width (width), height (high), fullscreen (full screen), ScrollBars (no transition bar without parameters in full screen, Channelmode (widescreen), left (open window x coordinate), Top (open window y-coordinate)
Window.location = "" View-source: "" + WINDOW.LOCATION.HREF Application Transaction View Web page source code;


A=new Date (); Create a for a new era object
Y=a.getyear (); The value of Y is the two-digit year from object A that gets the year value
Y1=a.getfullyear (); Get four-digit year of the year
M=a.getmonth (); Get month value
D=a.getdate (); Get Date value
D1=a.getday (); Gets the current value of the prayer
H=a.gethours (); Gets the current number of hours
M1=a.getminutes (); Gets the current number of minutes
S=a.getseconds (); Gets the current number of seconds


object. style.fontsize= "Text Size";
Unit: mm/cm/in inch/pc pa/pt point/px pixel/em text high
1in=1.25cm
1pc=12pt
1PT=1.2PX (800*600 resolution)
Text Font properties:
FontSize size
Family fonts
Color colors
FontStyle style, value is normal, italic italic, oblique italic and bold
FontWeight, with values ranging from 100 to 900, 900 the most coarse, light,normal,bold
letterspacing spacing, change between text interval, value is, 1pt,10px,1cm
TextDecoration: Text retouch; value, none Burun, underline underline, overline underlined
Background: text patron color,
BackgroundImage: Patron picture, take value as the insertion path of the picture


Click the Web body function to invoke the trigger:
1.onClick when the object is clicked
2.onLoad when the Web page opens, can only be written in the body
3.onUnload when a webpage is closed or separated, it can only be written in body
4.onmou RAID engine Optimized ver when the mouse hangs over it
5.onmou RAID Engine Optimization ut when the mouse separates objects
6.onmouseup when Mouse is released
7.onmousedown when the mouse presses the key
8.onFocus when an object acquires a core
9.onSelect when the text of an object is selected
10.onChange when the contents of the object are changed
11.onBlur when the object misses the core

Value returned when Onsubmit=return (SS ()) Table is monotonic

Straight border-bottom:1x solid Black
Dashed border-bottom:1x dotted black
Dot Dash border-bottom:2x dashed black
Dual line border-bottom:5x Double black
Groove border-bottom:1x Groove Black
Ridge-shaped border-bottom:1x Ridge Black


1
Edge Highlight Glow (color= color, strength= brightness size) <br/>
2. Degree reversal Fliph () flips the object to a degree 180 degrees <br/>
3. Flip Vertical FLIPV () to flip the object vertically 180 degrees <br/>
4. Object blur blur (Add=true/false direction= target strength= strength)
Add specifies whether the target strength fuzzy intensity of fuzzy direction fuzzy targets by impression school
5. Object transparent Alpha (OPACTION=0-100,FINISHOPACITY=0-100,STYLE=0/1/2/3)
Opaction the object's overall opacity value finishopacity when the object is tricked out of transparency, the entry specifies the opacity value of the stop transparency style specifies a transparent body format of 0 for overall transparency, 1 for line-type transparency, 2 for round transparency, and 3 for rectangular transparency
6. Remove color chroma (color= color value) to make the color in the object transparent to the region of the specified color
7. Build Shadow DropShadow (color= shadow color, offx= degrees to the left, offy= degrees down from the pixels)
8. Color Gray () to display the object in grayscale
9. Negative result invert () causes the object to have a negative result
10. Highlight light () to make the object appear black
11. Conceal Mask (color= color) make all objects mask once with a specified color
Opacity table transparency degree. 0~100,0 table fully transparent, 100 sheets completely opaque
Finishopacity table you want to set the gradient transparency result. 0~100.
Style table The shape of the transparent area. 0 Table of the same shape. 1 table linear. 2 Table radial. 3 Table rectangle.
Startx.starty the x and Y coordinates at the beginning of the table gradient transparency result.
Finishx,finishy the coordinates of x, y when the fade transparent result stops.
Add has to determine if there are original targets in the blurred results. The value is 0,1.0 table "No", 1 table "Yes".
Direction sets the target of the blur. The 0-degree table is vertically upward and 45 degrees is one unit. The default value is 270 degrees to the left. Left,right,down,up.
Strength can only be determined by integers. The width of the pixel that represents a dash will be blurred. The default is 5.
Color to be transparent.
Offx,offy is the offset of the target shadow of X, Y, respectively.
Positive refers to the projection style. 0 table transparent pixels generate shadows. 1 table only gives opaque pixels to generate shadows.
Addambient: Take part in the light source of the flank.
Addcone: Participate in conical light source.
Addpoint Participation Point Light
Changcolor: Change the color of light.
Changstrength: Change the intensity of the light source.
Clear: Clears all lights.
Movelight: Move the light source.
Freq is the frequency of ripples, which is required to produce a dash of the finished ripple in the specified area on the object.
Lightstrength can be used to enhance the effect of light and shadow. Obviously 0~100 positive integers, sine wave beginning position is 0~360度. 0 table from 0 degrees beginning, 25 table from 90 degrees beginning.
Strength table amplitude size.


Hand style= "Cursor:hand"
Crosshair style= "Cursor:crosshair"
Text style= "Cursor:text"
Wait style= "Cursor:wait"
Default style= "Cursor:default"
Help style= "Cursor:help"
E-resize style= "Cursor:e-resize"
Ne-resize style= "Cursor:ne-resize"
N-resize style= "Cursor:n-resize"
Nw-resize style= "Cursor:nw-resize"
W-resize style= "Cursor:w-resize"
S-resize style= "Cursor:s-resize"
Sw-resize style= "Cursor:sw-resize"
Se-resize style= "Cursor:se-resize"
Auto style= "Cursor:auto"

JS Basic usage 1

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.