1. addBack ()
A. Several adjacent nodes (including third-item) under the li of third-item)
$( "li.third-item" ).nextAll().addBack(). .css( "background-color", "red" );
B. Similar to the end () method, the selected div. after-addback and p elements
Note:
This method uses the Jquery library and is currently compatible with IE8. The stars in the two colors in this example are all placed in a png image. Of course there are other implementation ideas. This example shows that the current page has
Chapter 4 DOM manipulation
1. Operation attributes
In chapter 4, we have used jQuery to read and set CSS. In this chapter, we use jQuery to operate DOM.
This section describes a common method: attr ()
Parameter: attribute name and attribute
Translated by: Tie
Translated on: February 1, January 9, 2014
Original Article Date: January 1, January 6, 2014
Original article:Loading Scripts with jQuery
The JavaScript loaders loader is simple, powerful, and very useful. I have introduced some
Jquery version: 1.10.2
Google chrome can be executed normally.
IE11 and FIREFOX 26 have bugs.
Test 1Test 2Test 3Test 4
To submit multiple options to the server, select all options first. However, when $ ("# id123 option"). attr ("selected",
When calling a jquery ajax method, we sometimes need this method to return a value or assign a value to a global variable. However, we find that the program has not obtained the value we want after execution, at this time, it is very likely that you
Copy codeThe Code is as follows:IE output:
Firefox:
Copy codeThe Code is as follows:Copy codeThe Code is as follows:
No title page Script tag and access HTML pageScript tagThe script tag is used to embed some executable scripts in the HTML page.
Abstract: many designers who focus on user experience want to add the style switching effect when getting focus or hovering over the text box (input. In fact, it is very simple. We only need to get the text box on the page, and add the onfocus event
Compatible with the Iframe adaptive height of mainstream browsers. The js script is as follows:Copy codeThe Code is as follows:// Iframe highly adaptiveFunction iframeAutoFit (iframeObj ){SetTimeout (function (){If (! IframeObj) return;IframeObj.
Copy codeThe Code is as follows:// Function window. onunload () {alert ('This is what you want to do. It is done after you close the webpage! '); Location = 'sessionclear. aspx ';}// Function window. onbeforeunload () {alert ('This is what you have
In JS, window. opener only references the parent window of the pop-up window. For example:A.html, click "click" and click "other" to open a new window B .html. Contents.If this reference fails, null is returned. Therefore, before calling an opener
Similarly, this plug-in does not require any html tags. It only requires a corresponding class name in the input box and a class name in the parent level. No other class names are required. Internal HTML code is automatically generated.
The HTML
Summary: Here we reference Jorux's article "CSS needs to be rewritten for 95% of Chinese websites". The question is a bit scary, but it is indeed a defect in the production of domestic webpages. I have never been clear about the relationship and
3. Create a Custom Animation
We arrange "display/hide" in sequence as an animation!
JQuery provides a powerful method: animate ()
Today we will focus on the effects achieved when two parameters are used.
.animate({properties},duration);Before using
What is a deferred object? To generate a deferred object, you only need to call jQuery. the Deferred function, deferred, is used to indicate the delay, the then method in the deferred object may be able to find this delayed behavior. This article
How is the floating point calculation in js?
For example, var a = 0.69;
I want to get 6.9 to write var c = a * 10 directly like this;
Alert (c); the result is 6.8999999999999995.
After a search on the Internet, some netizens said this was a JS
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.