备份专用

jQuery如此流行,各式各样的jQuery插件也是满天飞。你有没有想过把自己的一些常用的JS功能也写成jQuery插件呢?如果你的答案是肯定的,那么来吧!和我一起学写jQuery插件吧!

jQuery如此流行,各式各样的jQuery插件也是满天飞。你有没有想过把自己的一些常用的JS功能也写成jQuery插件呢?如果你的答案是肯定的,那么来吧!和我一起学写jQuery插件吧!

using System;  

   

using Android.App;  
using Android.Content;  
using Android.Runtime;  
using Android.Views;  
using Android.Widget;  
using Android.OS;  
namespace HelloMonoAndroid  
{  
    [Activity(Label 
= "HelloMonoAndroid", MainLauncher = true, Icon = "@drawable/icon")]  
    
public class Activity1 : Activity  
    {  
      int count = 1;  
        
protected override void OnCreate(Bundle bundle)  
        {  
            
base.OnCreate(bundle);  
            
// Set our view from the "main" layout resource  
            SetContentView(Resource.Layout.Main);  
            
// Get our button from the layout resource,  
            
// and attach an event to it  
            Button button 
= FindViewById<Button>(Resource.Id.MyButton);  
            button.Click 
+= delegate { button.Text = string.Format("{0} clicks!", count++); };  
        }  
    }  



 




 

<p class="descriptionArea" style="border: 1px solid #CCC; margin: 10px; padding: 10px; font-size: 12px; background-color: #fbfaf0;">

(function($){
    $.fn.yourName = function(options){
        //各种属性、参数
        }
        var options = $.extend(defaults, options);
        this.each(function(){
        //插件实现代码
        });
    };
})(jQuery);
(function($){
    $.fn.yourName = function(options){
        //各种属性、参数
        }
        var options = $.extend(defaults, options);
        this.each(function(){
        //插件实现代码
        });
    };
})(jQuery);
posted @ 2011-04-02 11:21  卿之  阅读(89)  评论(0)    收藏  举报
无觅相关文章插件,快速提升流量