本文实例讲述了jquery简单插件制作方法。分享给大家供大家参考,具体如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><script type="text/javascript" src="jquery.js"></script><title>jquery简单的插件制作</title><script type="text/javascript">(function ( $ ) {$.fn.greenify = function ( options) {var settings = $.extend({ color:"#556b2f", backgroundColor:"#000", padding:"20px"}, options );return this.css( {color:settings.color,backgroundColor : settings.backgroundColor,padding : settings.padding});};}( jQuery ));$(document).ready(function(){$("div").greenify({color:"#000",backgroundColor:"#ccc",padding:"50px"})});</script></head><body><div id="accordion">jquery简单的插件制作</div></body></html>更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jquery中Ajax用法总结》、《jQuery表格(table)操作技巧汇总》、《jQuery拖拽特效与技巧总结》、《jQuery扩展技巧总结》、《jQuery常见经典特效汇总》、《jQuery动画与特效用法总结》、《jquery选择器用法总结》及《jQuery常用插件及用法总结》
希望本文所述对大家jQuery程序设计有所帮助。