Project common function encapsulation, based on Jquery

/// /** DIV or element center * @ return */jQuery. fn. mCenterDiv = function () {this.css ("position", "absolute"); this.css ("border", "1px solid # ccc"); this.css ("top ", ($ (window ). height ()-this. height ()/2 + $ (window ). scrollTop () +

Jquery advanced method description and Application

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

JQuery BUG: $. attr (& amp; quot; selected & amp; quot;, tru

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",

Detailed description of Script tag and HTML page access

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.

Sample Code for style change when the text box (input) gets the focus (onfocus)

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 iframe adaptive height js scripts of mainstream browsers

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.

Solution to closing the ie window and clearing the Session

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

JS input email automatically prompts [like Microsoft Live.cn]

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

Learning JQuery-12

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

Shutbox jquery refreshing comments

The database in this example is very simple and you will understand it at a glance.Demo XML/HTML Code Shoutbox Latest Messages Shoutbox. php PHP Code

Very comprehensive js time processing function Date. prototype. format

Date.prototype.format = function (mask){var d = this;var zeroize = function (value, length){if (!length) length = 2;value = String(value);for (var i = 0, zeros = ''; i 99) m = Math.round(m / 10);return zeroize(m);case 'tt': return d.getHours() A

JQuery callback and deferred object summary (Part 1) -- the magic then Method

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

Analysis of floating point computing problems in js

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

Javascript client traverses the control and obtains the sample code of the parent container object

1. traverse all the controlsFunction findControlAll (){Var inputs = document. getElementsByTagName ("input ");For (j = 0; j If (inputs [j]. type = "text") // you can find all the controls whose types are text, or set them to the control type you

Jquery modifies the property value instance code (sets the property value)

Set attributes-Attr ()The jQuery attr () method is also used to set/change attribute values. The following example shows how to change the value of the href attribute in the (SET) link: InstanceCopy codeThe Code is as follows:$ ("Button"). click

Simple Example (subform) in the js showModalDialog pop-up dialog box)

Copy codeThe Code is as follows: showModalDialog dialog box (subform) Text = "close"/> disable

Implementation of Non-recursive algorithms for Binary Tree first-order traversal

In the previous article, we talked about the recursive traversal algorithm of a binary tree (the improvement of the first root (First Order) traversal of a binary tree). This article mainly describes the non-recursive algorithm of a binary tree and

Two Methods for js to obtain the selected value of the select tag

Copy codeThe Code is as follows:Var obj = document. getElementByIdx_x ("testSelect"); // locate idvar index = obj. selectedIndex; // select the index var text = obj. options [index]. text; // select the var value = obj. options [index]. value; //

Expand some incompatible methods in IE, such as contains and startWith.

Copy codeThe Code is as follows:/*** Extended startWith Method* @ Param str* @ Return*/String. prototype. startWith = function (str ){If (str = null | str = "" | this. length = 0 | str. length> this. length)Return false;If (this. substr (0, str.

Total Pages: 5378 1 .... 5336 5337 5338 5339 5340 .... 5378 Go to: GO

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.