ada's profileAda的自由共享空间PhotosBlogListsMore ![]() | Help |
|
|
July 14 jquery小总结用法:一个jquery.js文件
$(document).ready(function(){}); -----------Ext.onReady(function(){});
.attr({'id':'','rel':'','title':''}) .removeAttr() not class 属性
.addClass() .removeClass()
.toggleClass()
事件
.bind() .click()
.toggle()
.hover()
.stopPropagation() .preventDefault()
.unbind()
.trigger()
.animate()
在元素中插入新元素
.append()
.appendTo()
.prepend() .prependTo(id)
在元素相邻位置插入新元素
.after(content) .insertAfter(id)
.before() .insertBefore()
在元素外部插入新元素 .wrap()
替换元素 .html() .text()
移除元素 .empty()
移除元素及其后代 但实际不删去 .remove()
复制元素:.clone(false)
效果
fadeIn() fadeOut() 不透明度
fadeTo() 不透明度
slideDown slideUp() 高度
.show('slow')
.hide()
.animate({left:'value1',height:'value2'},speed,function(){alert('the animation is finished .');})
ajax 部分
$().load('a.html'); $.getJSON('b.json',functon(data){}); $.getScript('c.js');$.get('d.xml',function(data){});
get请求 $.get('e.php',{'term':$(this).text().serialize()},function(data){$().html(data);})
post请求 $.post('e.php',{'term':$(this).text()},function(data){$().html(data);}) $().load('e.php',{'term':$(this).text()},function(data){$().html(data);})
$().ajaxStart(function(){}).ajaxStop(function(){}); TrackbacksThe trackback URL for this entry is: http://ll-lizi.spaces.live.com/blog/cns!C130D3132972F3ED!414.trak Weblogs that reference this entry
|
|
|