ada's profileAda的自由共享空间PhotosBlogListsMore Tools Help

Blog


    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(){});

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://ll-lizi.spaces.live.com/blog/cns!C130D3132972F3ED!414.trak
    Weblogs that reference this entry
    • None