Creating Jquery custom plugin -
do need include built-in plugin of jquery while creating custom plugin. have tried simple code , started learning it.. have done simple code isn't working..
$.fn.greenify = function() { this.css( "color", "green" ); }; $("a").greenify();
this needs jquery object, $(), jquery method .css() work. utilize this:
$.fn.greenify = function () { $(this).css("color", "green"); }; $("a").greenify(); solution in fiddle: http://jsfiddle.net/2mktx/
jquery jquery-plugins
No comments:
Post a Comment