文章标题
来源:互联网 发布:linux shell exec 编辑:程序博客网 时间:2024/06/06 11:43
//定义Beautifier的构造函数var Beautifier = function(ele, opt) { this.$element = ele, this.defaults = { 'color': 'red', 'fontSize': '12px', 'textDecoration':'none' }, this.options = $.extend({}, this.defaults, opt)}//定义Beautifier的方法 Beautifier.prototype = { beautify: function() { return this.$element.css({ 'color': this.options.color, 'fontSize': this.options.fontSize, 'textDecoration': this.options.textDecoration }); }} //在插件中使用Beautifier对象 $.fn.myPlugin = function(options) { //创建Beautifier的实体 var beautifier = new Beautifier(this, options); //调用其方法 return beautifier.beautify();}
使用:
$(function() { $('a').myPlugin({ 'color': '#2C9929', 'fontSize': '20px' });})
0 0
- 文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题 文章标题 文章标题 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 文章标题
- 逆向工程(一):汇编、逆向工程基础篇
- 第9周项目2 - 对称矩阵压缩存储的实现与应用(1).cpp
- leetcode刷题日记——Excel Sheet Column Number
- Struts2获取request的几种方式汇总(list对象获取)
- 查找
- 文章标题
- 第9周项目2 - 对称矩阵压缩存储的实现与应用(2).cpp
- Hadoop安装过程遇到的坑:
- [Linux]ubuntu下共享文件夹密码设置和重置-smbpasswd -a user
- (java)Length of Last Word
- 117Populating Next Right Pointers in Each Node II
- Android捕获异常处理——UncaughtExceptionHandler
- ajax+json+Struts2实现list传递实例讲解
- 论文笔记 Visualizing and understanding convolutional networks