备份专用
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
{
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++); };
}
}
}
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);
@:卿之 → http://www.cnblogs.com/wpdev
©:博文是本人当时的学习笔记及知识整理,由于自身局限错误在所难免,敬请斧正.
©:本文版权属于博客园和本人,版权基于署名 2.5 中国大陆许可协议发布,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接和署名卿之(包含链接),不得删节,否则保留追究法律责任的权利。

浙公网安备 33010602011771号