After following, you can keep track of his dynamic information in a timely manner
Courses in the relevant section:jQuery manipulates CSS
$("#btnAdd").bind("click", function(event) { $("p").addClass("colorRed borderBlue"); });
2016-11-240個贊
Courses in the relevant section:jQuery gets common attributes
我們希望獲取測試圖層的寬度,使用 attr 方法獲取"元素特性"為 undefined, 因為并沒有為 div 添加 width。而使用 css()方法雖然可以獲取到 style 屬性的值, 但是在不同瀏覽器里返回的結(jié)果不同
2016-11-240個贊
Courses in the relevant section:jQuery events and event objects
obj.onclick=function(){ var oEvent = window.event; }
2016-11-240個贊
Courses in the relevant section:Events in jQuery
也就是為click事件又添加了一個方法, 不會覆蓋對象的click事件原有的事件處理函數(shù).
2016-11-240個贊
Courses in the relevant section:Examples of common jQuery event functions
便于存儲和查找數(shù)據(jù). 但是自定義屬性通過不W3C驗證. 必須要自己想辦法存儲數(shù)據(jù), 并且要制定規(guī)則查找指定元素的數(shù)據(jù).
2016-11-240個贊
Courses in the relevant section:jQuery shortcut events
雖然我們可以使用事件處理函數(shù)完成對象事件的幾乎所有操作, 但是jQuery提供了對常用事件的封裝. 比如單擊事件對應的兩個方法click()和click(fn)分別用來觸發(fā)單擊事件和設置單擊事件.
2016-11-240個贊
Courses in the relevant section:jQuery interactive help methods
<script type="text/javascript"> function report(event) { $('#console').append('<div>'+event.type+'</div>'); } $(function(){ $('#outer1') .bind('mouseover',report) .bind('mouseout',report); $('#outer2').hover(report,report); }); </script>
2016-11-240個贊
Courses in the relevant section:jQuery event object
jQuery 事件對象將不同瀏覽器的差異進行了合并,比如可以在所有瀏覽器中通過 event.target 屬性來獲取事件的觸發(fā)者(在 IE 中使用原生的事件對象,需要訪問 event.srcElement)。
2016-11-240個贊
Courses in the relevant section:Raw Ajax vs. Ajax in jQuery
$("#divResult").load("data/AjaxGetCityInfo.aspx", { "resultType": "html" });
2016-11-240個贊
Courses in the relevant section:Detailed explanation of jQuery Ajax
load是一個jQuery包裝集方法,需要在jQuery包裝集上調(diào)用,并且會將返回的HTML加載到對象中, 即使設置了回調(diào)函數(shù)也還是會加載
2016-11-240個贊
Courses in the relevant section:Ajax related functions
有時我們希望設置頁面上所有 Ajax 屬性的默認行為.那么就可以使用此函數(shù)設置options選項, 此后所有的 Ajax 請求的默認options將被更改
2016-11-240個贊
Courses in the relevant section:Global Ajax events
全局事件永遠不會再跨域的腳本中運行,也不會再JSONP請求中運行。 在jQuery1.9以上,所有的全局ajax函數(shù)必須綁定掃到document上,也就是$(document).事件 只有在$.ajax()亦或$.ajaxSetup()中的globle設置成true才能使用ajax全局函數(shù),false將不能使用。
2016-11-240個贊
Courses in the relevant section:A preliminary understanding of jQuery animation
彈出層的位置需要動態(tài)計算. 因為觸發(fā)彈出事件的對象可能出現(xiàn)在頁面的任何位置, 比如截圖中的位置. 為document綁定單擊是關(guān)閉彈出層的函數(shù), 要使用多播委托, 否則可能沖掉其他人在document綁定的函數(shù). 為document綁定了關(guān)閉函數(shù)后, 需要在顯示函數(shù)中取消事件冒泡, 否則彈出層將顯示后立刻關(guān)閉
2016-11-240個贊
Courses in the relevant section:jQuery basic animation functions
$("#divPop").show(200); $("#divPop").hide("fast"); $("#divPop").toggle("slow");
2016-11-240個贊
Courses in the relevant section:jQuery sliding animation function
slideDown就是show的滑動效果版本, slideUp就是hide的滑動效果版本, slideToggle就是toggle的滑動效果版本
2016-11-240個贊