jq builder

Read about jq builder, The latest news, videos, and discussion topics about jq builder from alibabacloud.com

The common code of JQ collected online

(). Top},500) ;}$ ('. Area_name '). AutoScroll (); testing various browsers:if ($.browser.safari)//Detect Safariif ($.browser.msie $.browser.version > 6)//Detect IE6 and later versionsif ($.browser.msie $.browser.version   if ($.browser.mozilla $.browser.version > ' 1.8 ')//Detect Firefox2 and later versions11. Replace the words in the string:var el = $ (' #id '); El.html (el.html (). Replace (/word/ig, "));12. Disable the right-click context menu:  $ (document). Bind (' ContextMenu ', funct

(JQ plugin) Get Verification code

This is a simple example. But it's a lot of places to use.A simple plug-in on the City of encapsulation 1 --> 2 type = "text" ID = "Re_email" /> input type = "button" ID = "Getyzm" value = "Get Verification Code" > 1Instance Address: Http://files.cnblogs.com/files/lyqweb/Countdown.rar(JQ plugin) Get Verification code

JQ countdown for a certain time period

JQ countdown for a certain time period

JQ input numbers and decimals

Only numbers can be entered$ ('. Text '). KeyUp (function () {$ (this). Val ($ (this). Val (). replace (/^0+/g, ""). Replace (/[^0-9]/g, "))})Enter numbers and decimals (accurate to two digits after the decimal point)$ ('. Text '). KeyUp (function () {var number = $ (this). Val (). replace (/^\./g, ""). replace (/[^\d.) /g, ""). replace (".", "$#$"). replace (/\./g, ""). replace ("$#$", "."). Replace (/^ (\-) * (\d+) \. ( \d\d). *$/, ' $1$2.$3 ')$ (this). Val (number);})

Usage of each in JQ

Several common uses of each of the jquery methodsEach () method makes the DOM loop structure concise, traversing one-dimensional arrays, multidimensional arrays, DOM, JSON, and so on.var arr = ["One", "one", "three", "four"]; function() { alert ( ThisThe results for each of the above outputs are: One,two,three,fourvar arr1 = [[1, 4, 3], [4, 6, 6], [7,, 9]] function(i, item) { alert (item[0]); }); In fact, ARR1 is a two-dimensional array, item is equivalent to

JQ Seamless Scrolling

JQ Seamless Scrolling

JQ Learning (ii)

() Gets the ancestor element of each element in the current matching element collection, optionally filtered by the selector. . Parentsuntil () Gets the ancestor element of each element in the current matching element collection until it encounters an element that matches the selector. . Prev () Gets the previous sibling element immediately adjacent to each element in the matching element collection, optionally filtered by the selector. .

JQ Limit text box numeric decimal letter

//// ----------------------------------------------------------------------$.fn.onlynumalpha =function () { This. Bind ("KeyPress",function(event) {varEVENTOBJ = Event | |e; varkeycode = Eventobj.keycode | |Eventobj.which; if((keycode >= keycode )) return true; Else return false; }); This. bind ("Paste",function () { varClipboard = Window.clipboardData.getData ("Text"); if(/^ (\d| [A-za-z]) +$/. Test (clipboard))return true; Else return false;

JQ Auto Complement UI

$ (function () { $ ('. Button2 '). button (). css (' color ', ' #555 ') $ (' #loga '). Click (function () { $ (' #loglike '). Dialog ( {autoopen:true, Modal:true, WIDTH:350, HEIGHT:300, Resizable:false, Title: ' User Registration ', Buttons: { ' Submit ': function () {alert (' Registering, please wait ... ')} } }); var host=[' a ', ' AA ',

JQ tab Toggle

$ (' H1 '). Click (function () {var index = $ (this). index (); $ ('. Content '). EQ (index). Show (). addclass (' active '). Siblings (). Removeclass (' active '). Hide ();});Use the index to identify the click of the subscript is the click of the number of points, and then use the EQ to put this index number in, so that you click on the one by one corresponding, equivalent to binding, show addclass what to say, Siblings is to say that in addition to the other points in your selection, such as

Banner Carousel with simultaneous scrolling of small color strips JQ

. Headline1 ').Width (); VarUlwidth =width*5; $('. Tongcheng ').Widthwidth); $('. Tongchengul li ').Widthwidth); $('. Tongchengul ').WidthUlwidth); Vart =SetInterval (‘Lunbo()‘,2000);}); functionLunbo () { if (!$('. Tongchengul ').Is (": Animated")) { Varwidth =$('. Tongcheng. Headline1 ').Width (); VarLength =$('. Tongchengul li ').Length VarUlwidth =width*Length VarMarginLeft =parseint ($('. Tongchengul ').css' Margin-left ')); VarMaxmarginleft = (parseint (ulwidth/width)-1) *Width IfMarginlef

How to write the JQ plugin?

,Hovercolor: "Black" }; VarOptions=$.Extend(Defaults,Options); Return This.each(function () { VarO=Options; Assigning an element collection to a variable in this case, the UL object VarObj=$(This); Get the A object in UL VarItems=$("Li a",Obj); Add hover () event to aItems.Hover(function () {$(This).Css("Color",O.Hovercolor); Queue false means not added to the animation queue$(This).Animate({Paddingleft:O.Animatepadding}, {Queue: False,Duration: 300 }); }, function () {$(This).Css("Color", "");$

JQ Bullet Box Confirmation

function Delcustomer (id,num) {var r=confirm ("Friendly reminder: Are you sure you want to delete a customer?" ");if (r==true) {$.ajax ({Type: "POST",URL: "${contextpath!} /my/customer/delcustomer ",Data: "Id=" +id,Success:function (data) {if (data! = NULL) {var jsondata = eval ("(" +data+ ")");var message = Jsondata.message;var status = Jsondata.status;if (status = = "OK") {$ ('. Lists '). empty ();GetList ();}else{Wxalert (message);Return}}}});}JQ B

JQ encapsulates the plug-in you need (two methods)

1, (function ($) { //($) To prevent conflict $.fn.extend ({ //jquery method Check:function () {return This.each () {this.ch Ecked = true; }); }, uncheck:function () {return This.each (function () {this.checked = false;}); } );   2. (function ($) { //Prevent conflict jquery.extend ({ //tool method Min:function (A, b) {return a   JQ encapsulates the plug-in you need (two methods)

JQ Typing effect

DOCTYPE HTML>HTMLLang= "en">Head>MetaCharSet= "UTF-8">title>JQ subtitle Typing effecttitle>style>*{margin:0;padding:0;}Body{Background-color:#000;Color:#00FF00;padding:100px;font-size:30px;}. Hide{Display:None;}style>Head>Body>div for output text -DivID= "Showbox">Div>text that you want to output -Divclass= "Hide"ID= "Contowrite">Login:usernameBR>Password: ******BR>Access is grantedBR>What about Chinese? Div>Scriptsrc= "Http://www.lamahui.com/static/1

About JQ $.deferred ()

) Deferred.fail () specifies the callback function when the operation fails(4) Deferred.promise () when there are no parameters, the function is to keep the running state of the deferred object unchanged; When the parameter is accepted, the role is to deploy the deferred interface on the Parameter object.(5) Deferred.resolve () manually changes the running state of the deferred object to "completed", triggering the Done () method immediately.(6) $.when () specifies a callback function for multip

JQ Modify Style

//gets the current URL varUrl=Document.location.href; varUrl_cn= ' Http://www.macau-airport.com/cn/our-business/for-rental/mia-tender-notice '; varurl_mo= ' Http://www.macau-airport.com/mo/our-business/for-rental/mia-tender-notice '; varUrl_en= ' Http://www.macau-airport.com/en/our-business/for-rental/mia-tender-notice '; varurl_ko= ' Http://www.macau-airport.com/ko/our-business/for-rental/mia-tender-notice '; varUrl_ja= ' Http://www.macau-airport.com/ja/our-business/for-rental/mia-tender-no

JQ's Live (), on (), Deletage (), bind () several differences

Today on the Internet to see an article, about JQ inside the difference between the event binding, said I look after the understanding, I rookie a, a lot of things do not understand, there is a wrong understanding of the great gods and more adviceThe bind () method is the most straightforward method of binding an event, which is the longest-lasting method of binding to the document, and it solves the compatibility problem well.Advantages of the Bind (

jquery selector Best Practices-from JQ website

1. Query based on the ID selector and use the Find method.1 // Fast 2 $ ("#container div.footer"); 3 4 // super fast 5 $ ("#container"). Find ("Div.footer");Using the Find method reduces the time it takes to traverse a node.2, when using the hybrid selector, the selector on the right is best to be specific.1 // before optimization 2 $ ("Div.data. Footer"); 3 4 // after optimization 5 $ (". Data Div.footer");On the left, it is best to use a selector such as tag or class, preferably on the right w

Solve the problem that the. animate () function of JQ is in IE6.

Recently, I have been thinking about JQ in the project, so some of my experiences have been put up in a timely manner. I would like to ask you if I have any questions. In the project, the left menu is folded and displayed, which is common in the software interface (originally copy a section on the InternetCodeThis is the case. It is estimated that the writing is better than me, but learning requires a Learning Spirit ^ !), I used. animate () to hi

Total Pages: 15 1 .... 11 12 13 14 15 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.