Note: jQuery in action / Chap.1

選擇器
$(selector)

包裹器 wrapper

淡出
$(" “).fadeout();

淡出,新增一個css類別removed至每一個元素
$(" “).fadeout().addClass(“removed");

jQuery 的html方法:將DOM元素的內容換為html標記
$(“someElement").html(“This is Joe");

$(“p:even"); // 取所有偶數

元素
$(“tr:nth-child(1)");//取每個表個的第一列
$(“body>div");//取body的div子元素
$(“a[href$:pdf"})//取pdf檔
$(“body>div:has(a)")//取body直接div元素(contain a link)

jQuery another function: to be a utilityof namespace prefix
$.trim(someString);//裁字串前後空格

文件備妥處理器:
jQuery provide an easy way: once loading DOM, it trigger code.
$(function){){
};

建DOM元素
$(“

This is Joe

“)

擴充jQuery
結合jQuery與其他程式庫:jQuery.coConflict();

Advertisements
發表留言

10 則迴響

  1. Hi, this weekend іs goоd designed for mе, since thіѕ moment i am reading this wonderful informative piece оf writing
    heгe at my Һome.

    喜歡

  2. good , thks for sharing.

    喜歡

  3. i just make a note, not really involved in programming activities yet. But feel getting better understanding. It’s not very practical for me doing hand code for front end development. I just use finished tools for web development as I need. Anyway, I will keep upgrading.

    喜歡

  4. it feels good to get information what i was looking for in suchh a beutiful
    and well explained manner thanks a lot keep writing thanks ,
    i checked 10 other places to get information but your blog
    helped me get exactly what i wanted to know thank you so much,

    i thiknk you shoould write more often and on moree subjects because
    you pass on a lot of positive enegry,

    i loke the theme and concept oof your blog,keep going
    you are really doig a good job

    喜歡

  5. Thanks for your comment. I should also write something in English. Too many new techs, how can we catch up all? I read and write about new tech. I involve more as needed practically. Cheers,

    喜歡

  6. Simply want to say your article is as amazing.
    The clarity in your post is just excellent and i can assume you’re an expert on this subject.
    Fine with your permission allow me to grab your feed to keep up to
    date with forthcoming post. Thanks a million and please keep up the
    rewarding work.

    喜歡

  1. 前端工程師 | Joe
  2. JavaScript | Joe
  3. jQuery | Joe

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s

%d 位部落客按了讚: