(function($){
$.fn.ChangeStyle = function(options,msg){
var opts = $.extend({},$.fn.ChangeStyle.defaults, options);
this.css("background",opts.background);
this.css("color",opts.color);
//private method
Note(msg);
//public method
$.fn.ChangeStyle.customAction();
};
function Note(msg)
{
if(undefined != msg)
{
alert(msg);
}
}
$.fn.ChangeStyle.defaults = { background:"#999",color:"red"};
$.fn.ChangeStyle.customAction = function(){};
})(jQuery);
//Invoke the pluign example
$(function()
{
//set properties
//$("form").ChangeStyle.defaults.background = "#f1f1f1";
//$("form").ChangeStyle.defaults.color = "blue";
$("form").ChangeStyle.customAction = function(){ alert("this is custom action")};
$("form").ChangeStyle({ background:"#999",color:"red"},"hi");
});