The Code is a bit unscrewed and needs to be encapsulated! So we have the following simple DialogHelper helper class, because the focus of this article is the idea, so the current version of the code is still very rough. The train of thought is
Special characters selected:# Id. Indicates class* Select all, Select multipleSpace descendant> Sub-~ Brother+ Next: Sub-function)() Functional filtering and searchingGet all the title objects under the div: $ ("div: header ")Copy codeThe Code is as
1: actual needs Large websites are prone to conflicts. users who want to see more things on the homepage do not want to waste too much server traffic. For example, a three-screen homepage. Maybe 50% of users enter the home page to click the
Test the browser version:IETester 6, 7IE 8.0Firefox 3.5.5Google Chrome 4.1.249.1064 (45376)Opera 9.64Safari 4.0Let's take a look at the coordinate attributes of various mainstream browsers and their meanings.In IEEvent. offsetXEvent. offsetYRelative
ShowModalDialog and showModelessDialog1. What are the differences between showModalDialog and showModelessDialog?ShowModalDialog: after being opened, the input focus is always maintained. You cannot switch to the main window unless the dialog box is
The effect is as follows:Implementation Code: F5 Refresh after running Jquery square with the mouse zoom in on the region [Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Style sheets can be created in three ways:Inline Style: it is written in the Tag. The embedded Style is only valid for all tags.Internal Style Sheet: it is written in the HTML . The internal Style is only valid for the webpage.External Style Sheet:
Typical code exampleCopy codeThe Code is as follows:Yepnope ({Test: Modernizr. geolocation,Yep: 'normal. js ',Nope: ['polyfill. js', 'wrapper. js']}); When Modernizr. geolocation is true, load the yep item, that is, "normal. js". Otherwise, load the
What is. live (). The live method is similar. bind (). In addition, it allows you to bind events to DOM elements. You can bind events to elements that do not exist in the DOM. Take a look at the following example:For example, when a user clicks a
Speaking of the basic mechanism of JavaScript prototype inheritance, this article details the inheritance of constructors.From a simple example, create a People constructor that describes humans:Copy codeThe Code is as follows:Function People
I just discussed a very interesting question with my colleagues. There is an idea that needs to record the user's content selected on the page. Under ff and ie9, there is a w3c dom2 event createRange, which is no longer cumbersome here. The main
Background:The whole function is actually to extract data from the database and play it on the interface. Simply put, it is similar to watching videos online and listening to music on the Internet, but what I get is string data, they take the stream
Example: the effect we want to achieve is that when the user clicks the mouse, a number of new data will be appended to the old data.If the standard DOM is used, the complete code is as follows:Copy codeThe Code is as follows: test data Note: once
Copy codeThe Code is as follows:/** Usage:* Var d = new Drag ({id: 'dragpannel ', maxLeft: 500, maxTop: 200 });* D. ready ();* Note:* The left and top styles of the dragged object must be written in the style attribute.**/// Corrected the caller.
Copy codeThe Code is as follows: test The result is not similar to the general statement. Using array will be faster. In ie9, 8. Ff, google, sogou, and Other ie core browsers are tested. It is true that the array method is slower than the "+"
Copy codeThe Code is as follows:$ (Function (){PageJs. urls = ['/', 'Index ',];PageJs. run ();});// The functions include html elements. Ajax function also can be put here.Var Common = {Init: function (){Alert ('common ');}};// Url -- pagesVar Index
Then, I wrote the following html:
11 12 13 21 22 23 31 32 33
Expected results:
So I wrote the following jQ:
$ (". A: nth-child (2)" ).css ("color", "red ");
The running result is:
I have no idea .. Finally, we found that we
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