jquery has a powerful way to manipulate HTML elements and attributes.A very important part of this is the ability to manipulate the DOM.dom--the Document Object model.1 DOCTYPE HTML>2 HTML>3 Head>4 MetaCharSet= "Utf-8">5 Scriptsrc= "Https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js">Script>6 Scripttype= "Text/javascript">7 $(function(){8 $("#btn1"). Click (function(){9 Alert ("Text:"+$("#test"
$ (this). DataGrid ("SelectRow", rowIndex);//Select the row $ (' #menu ') according to the Index. Menu (' show ', { //Display right-click menu left:e.pagex,//Show Menu Top:e.pagey} at mouse click ); E.preventdefault (); Prevent browser from bringing up the right-click menu Popup });Here is the effect after the implementation:Now just a simple implementation of the right-click menu, and later there will be improvements. What we do
$ (document). The Ready () method vs OnLoad event vs $ (window). Load () methodThe first thing you'll learn when contacting jquery is when to start an event. For a long time, events that were raised after loading the page were loaded into the "Body" onload event.There are a number of drawbacks to the body onload event compared to jquery's Ready method. For example:1. Problems with loading multiple functions
"Building cross-platform App:jquery mobile app" launched by Tsinghua University PressAll the examples of jquery mobile are provided:Mobile phone intrusionApplicationMusic albumsContactsNews listSales rankingsNine GonggeCurriculumAlbumElectronic reading DeviceCalculatorNotepadUniversity Mobile Campus ProjectPersonal blog ItemsOnline music playerOnline video playerCollege Campus Confession WallMemorize word items every day650) this.width=650; "Src=" htt
"Building cross-platform App:jquery mobile app" launched by Tsinghua University PressAll the examples of jquery mobile are provided:Mobile phone intrusionApplicationMusic albumsContactsNews listSales rankingsNine GonggeCurriculumAlbumElectronic reading DeviceCalculatorNotepadUniversity Mobile Campus ProjectPersonal blog ItemsOnline music playerOnline video playerCollege Campus Confession WallMemorize word items every day
1 DOCTYPE HTML>2 HTML>3 Head>4 MetaCharSet= "Utf-8">5 Scriptsrc= "Https://cdn.bootcss.com/jquery/1.10.2/jquery.min.js">Script>6 Scripttype= "Text/javascript">7 $(function(){8 $("#btn1"). Click (function(){9 $("#test1"). Text (function(i,oldval) {Ten return "Old text:"+Oldval+"new text: You and I he study it (index:"+I+")"; One }) A }) - $("#btn2"). Click (function(){ - $("
It was a long time since the implementation of jquery animate was very interesting, but the previous period was very busy, until a few days ago the Dragon Boat Festival holiday only time to study.Each animation transition effect of jquery.animate is achieved through the easing function . Two such functions are preset in jQuery1.4.2:easing: {linear: function( p, n, firstNum, diff ) {return firstNum + diff * p;},swing: function( p, n, firstNum, diff ) {
").bind({ "click": function () { console.log("bind-obj:click1"); }, "click": function () { console.log("bind-obj:click2"); }, "click": function () { console.log("bind-obj:click3"); } });Two, the difference between the element binding eventFirst, the conclusion: by invoking the event name and bind in a way that binds only the elements that existed before, the added element cannot bind the event, while the delegate and on bind element
Although this is not a very advanced technology, but for beginners is still quite difficult. If you are a novice, I hope you can learn something from this article, if you are a master, I hope you can leave your valuable comments and suggestions
A. What plugins do you want to do?
I want to implement a menu plug-in that can be used in a Web site or Web application, with a flexible, customizable look, simplicity, ease of use, easy expansion, and stabili
jquery provides us with a number of useful methods and attributes, and summarizes some of the commonly used functions, methods. Personally think in the development will be more commonly used, only for everyone to learn and reference.
Event handling
Ready (FN)
Code:
$(document).ready (function(){ // Your code here... });
Role: It can greatly improve the response speed of Web applications. By using thi
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.