Benx Blog

七月 29, 2012

Diigo Diary 07/29/2012

Filed under: Diigo Diary — benxshen @ 8:30 上午
  • tags: jquery api jquert1.7 new-features

    • Example: Cancel only the default action by using .preventDefault(). 

       

      $("form").on("submit", function(event) {
       
      event.preventDefault();
      });

       

       

       

      Example: Stop submit events from bubbling without preventing form submit, using .stopPropagation(). 

       

      $("form").on("submit", function(event) {
       
      event.stopPropagation();
      });
    • <script>

      $(“p").on(“myCustomEvent", function(e, myName, myValue){
        $
      (this).text(myName + “, hi there!");
        $
      (“span").stop().css(“opacity", 1)
         
      .text(“myName = “ + myName)
         
      .fadeIn(30).fadeOut(1000);
      });
      $
      (“button").click(function () {
        $
      (“p").trigger(“myCustomEvent", [ “John" ]);
      });

      </script>

  • tags: jquery api jquert1.7 new-features

  • tags: jquery api jquert1.7 new-features

Posted from Diigo. The rest of my favorite links are here.

發表迴響 »

仍無迴響。

RSS feed for comments on this post. TrackBack URI

發表迴響

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

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

在WordPress.com寫網誌.

%d 位部落客按了讚: