1 absolute Positioning (ABS) and relative positioning (relative)
The difference is the relative positioning of the reference to its own location to move (of course, you need to set the top left these take effect) and the original position of the offset will be
Other layers cover.
Absolute positioning is the reference position is not the same as the relative is their own, as to which is to see its superiors or superiors have no position on the position:relative
or position:fixed, etc. when the layer to be absolutely positioned is set to reference the position of the layer, you can use the top left to set the position if its superiors or superiors are not positioned
It will be positioned according to the body's position, and the last point is that the absolute position is not occupied.
CTRL + SHIFT + DELETE clears the browser cache 2 There are three ways to submit a form in project development:
The first type: Use the form to bring the property action to commit
The second type: Submit with jquery: $ ("#formid"). Submit ();
The third type: Commit with Ajax:
However, if there is a lot of data in the form form, it is not possible to list each one, just use $ (' #yourformid '). Serialize ()
1 The conflict between jquery and other libraries can be a $ (DOM object). Ready (function () {}) is a function of the entry function is the difference between a jquery sub-selector and a descendant selector:
① does not have the same wording:
Descendant selectors are identified as: spaces
such as: UL li{width:150px;} "between Ul and Li is separated by a space"
The child selector is identified as:>
such as: ul>li{width:150px;} "> separated between UL and Li" ② function is not the same:
Descendant selectors are all Li elements in an element that are surrounded by a selection of UL, including child elements, grandchild elements, great-grandchild elements, and so on.
The sub-selector selects only the LI element in the child elements enclosed by UL, not including the grandchild element, the great-grandchild element, and so on.
③ compatibility is not the same:
Descendant selectors are available for all browsers that are compatible with them.
Sub-selectors in IE6, IE7, IE8 are not supported selectors, each bug. 1 Basic Filter Selector:
: First: $ ("P:first") <p> element
: Last $ ("P:last") Final <p> element
: Even $ ("Tr:even") all even <tr> elements
: Odd $ ("tr:odd") all odd <tr> elements
: EQ (Index) $ ("UL Li:eq (3)") in the list of fourth elements (index starting from 0)
: GT (NO) $ ("UL li:gt (3)") lists elements with index greater than 3
: LT (No) $ ("UL Li:lt (3)") lists elements with index less than 3
: Not (selector) $ ("Input:not (: Empty)") all input elements that are not empty
2 Visibility Filter Selector
: Hidden $ ("P:hidden") all hidden <p> elements
: Visible $ ("table:visible") all of the available tables for the jquery action page
1 Show or hide page content
Syntax: $ (selector). Show (Speed,callback);//Show hidden functions
$ (selector). Hide (Speed,callback);//Hide function
$ (selector). Toggle (Speed,callback);//display and hide can automatically switch is no longer a single toggle display
The toggle () function Toggles the visible state of the page element
Speed setting shows the velocity slow,fast or milliseconds
Callback set the function to execute after the action is completed
Realize the fade-in effect of the light illusion
FadeOut () Fade out fadeIn () fade in
Slide Hide of the page
Slide hide effect via ' slideup () ' function
The slide display effect is implemented by the ' Slidedown () ' function
jquery Animated Animate method
Syntax: $ (selector). Animate ({params},speed,callback);
The required params parameter defines the CSS property that forms the animation.
The optional Speed parameter specifies the duration of the effect, which can take the following values: "Slow", "last", or milliseconds.
The optional callback parameter is the name of the function that is executed after the animation is completed. jquery gets HTML
Three simple and practical jquery methods for DOM manipulation:
Text ()-Sets or returns the text content of the selected element
HTML ()-Sets or returns the contents of the selected element (including HTML markup, which is HTML code)
Val ()-Sets or returns the value of a form field the label label is used alone it makes no sense to combine the use of the input tag.
Wait, set the jquery login front-end validation Gets the index value of the current element
1 index () function to get the indexed value of the current element
The index () function returns the index position of the specified element relative to the other specified element, which can be
jquery selector or DOM element to specify the insertion node element
1 append () function (inserts a newly created node element into a document)
Syntax: $ (selector). append (content);
(The content parameter indicates that the contents to be inserted can contain HTML tags)
2 AppendTo () function inserts the specified content at the end of the selected element (still inside)
Syntax: $ (content). AppendTo (selector);
(the selector parameter indicates which element to append the content to)
3 prepend () function (inserts the newly created node element into a document)
Syntax: $ (selector). prepend (content);
4 Prependto () function inserts the specified content at the end of the element (still inside)
Syntax: $ (content). Prependto (selector)
5 after () function inserts the specified content after the selected element
Syntax: $ (selector). After (content)
6 InsertAfter () function inserts an HTML tag or an existing element after the selected element
Syntax: $ (content). InsertAfter (selector)
7 before () function inserts an HTML tag or an existing element after the selected element
Syntax: $ (selector). Before (content)
8 InsertBefore () function HTML tags or existing elements before the selected element
Syntax: $ (content). insertbefore (selector);
Copy node elements
Clone () function to complete the node element copy function
$ (this). Clone (True). AppendTo ("ul")
Add content that can be appended to the copied node
For example, by clicking Copy Append add content
Replace node element
The ReplaceWith () function replaces the selected element with the specified HTML content or element
$ (selector). ReplaceWith (content)
To delete a node element
The Remove () function removes the selected element including all of its text and child nodes
The empty () function removes all content from the selected element, including all of its text and child nodes
$ (selector). Empty ()//This is the right way to write
Extension point: $ (selector). Remove () and Var $li =$ (selector). Remove () What's the difference? jquery attribute action method (DOM)
AddClass () The class name specified for the matching element
attr () Sets the property and value of the matching element to be returned//the specified parameter setting value through anonymous function functions () {}
Hasclass () checks whether the matching element owns the specified class
HTML () Sets or returns the HTML content in the matching element collection
Removeattr () Removes the specified property from all matching elements
Removeclass () Removes all or the specified class from all matching elements
Toggleclass () to add or remove a class from a matching element
Val () Sets or returns the value of the matching element
jquery CSS Manipulation functions
CSS () Sets or returns the style properties of a matching element
Height () Sets or returns the heights of the matching elements
Offset () returns the position of the first matching element relative to the document
OffsetParent () returns the nearest positioned ancestor element
Position () returns the position of the first matching element relative to the parent element
ScrollLeft () Sets or returns the offset to the left of a matching element relative to the scrollbar
ScrollTop () Sets or returns the offset of the element relative to the top of the scroll bar
Width () Sets or returns the widths of the matching elements
Parent (). Next (): Represents the next node of the parent node of the current node (what is the location of the next node) do a form validation with jquery
1 Ensure that users enter legitimate data in forms
2 Reduce the pressure on the server
How to do form validation:
1 Gets the Value property of the corresponding form label Val ()
2 Determine if the obtained value meets the requirements
3 Timing of validation (local validation global validation)
What is a regular expression:
A regular expression is a text pattern that includes ordinary characters (such as letters A through Z) and special
Characters (called "metacharacters")
2 What is the use of regular expressions?
Test patterns within a string
Replace text
Extracting a string from a string based on pattern matching
3 declaring a regular expression,
Direct use of double slash definition: var reg=/^ expression $/;
New RegExp (' expression '): Var reg=new RegExp ("expression"); Regular expressions commonly used symbols:
() The content inside the parentheses is a whole
[] matches any one of the contents of the brackets
^ matches the position at the beginning of the input string, except when used in bracket expressions
In that case, it takes the inverse of the character set
{} tag Qualifier expression start
| Indicates a choice between two items
$ matches the position of the end of the input string
* 0 or more times matches the preceding character or sub-expression 0~n
+ Match the preceding character or sub-expression one or more times 1~n
\ marks the next character as a special character or a literal character or a backward reference or a
Octal escape character
? Matches the preceding subexpression 0 or one time 0~1 \d matches a numeric character [0~9]
\w matching includes underscore any word character equivalent to "[A-Z-A-Z 0-9]" common
\w matches any non-word character equivalent to "[^a-z A-Z 0-9]". Common
\ n matches a newline character equivalent to \x0a and \CJ.
\b Matches a word boundary
Application of \b to match non-word boundary idle time with enhanced regular expression
1 What is Ajax?
ajax= asynchronous JavaScript and XML Ajax are techniques for creating fast, Dynamic Web pages
About jquery and Ajax
jquery provides multiple AJAX-related methods through the jquery Ajax method you can use HTTP GET
HTTP POST request text HTML XML or JSON from a remote server while you can put these external data
Loading a page directly into the selected element if there is no jquery Ajax programming is somewhat difficult in jquery the understanding of the Load method is $ (selector). Load (Url,data,callback)
URL: The address you want to request
Data: Transmitted
Callback: function action to be performed after loading the load function description of the event in 2jquery Ajax: Details see jquery Ajax API Documentation 3 common ways to request-respond on the client and server side:
get-request data from the specified resource:
Syntax: $.get (url,callback);
The first argument to $.get () is the URL we want to request the second parameter is the callback function.
The first callback parameter holds the contents of the requested page the second callback parameter holds the requested State. Post-submitting the data to be processed to the specified resource
Syntax: $.post (url,data,callback);
The first parameter of $.post () is the state (data) in which we want the requested URL to be the second parameter that holds the request
The third parameter is a callback function.
Get basic used to obtain (retrieve) data from the server Get method may return cached data post can also be used to
Fetching data from the server but the Post method does not cache the data and is often used to send data together with the request
4ajax Creating XMLHttpRequest Objects
1 XMLHttpRequest is the basis of Ajax
2 XMLHttpRequest for exchanging data in the background with the server
3 syntax for creating XMLHttpRequest objects:
Variable=new XMLHttpRequest ();
In order to deal with some of the new browsers now to check whether the browser supports XMLHttpRequest
Create ActiveXObject if not supported. The code is as follows:
var xmlhttp;
if (window. XMLHttpRequest)
{//code for ie7+ Firefox,chrome,opera,safari
Xmlhttp=new XMLHttpRequest ();
}else
{//code for IE6,IE5
Xmlhttp=new ActiveXObject ("Microsoft.XMLHTTP");
}
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