摘要: var x = companyNode.offset().left;var y = companyNode.offset().top+height; 阅读全文
posted @ 2013-01-23 17:02 mabel_on_line 阅读(350) 评论(0) 推荐(0) 编辑
摘要: jQuery插件的开发包括两种:$.fx是类级别的插件开发,即给jQuery添加新的全局函数,相当于给jQuery类本身添加方法,jQuery的全局函数就是属于jQuery命名空间的函数。调用:$.fx('#id');$.fn.fx是对象级别的插件开发,即给jQuery对象添加方法。 调用:$('#id').fx();参考资料http://www.iteye.com/topic/545971 阅读全文
posted @ 2013-01-23 16:44 mabel_on_line 阅读(2167) 评论(0) 推荐(2) 编辑
摘要: String.prototype.trim = function() { return $.trim(this);};(function($) {$.substitute = function(template, data) { return template.replace(/\{([\w\.]*)\}/g, function (str, key) { var keys = key.split("."), value = data[keys.shift()]; $.each(keys, function () { value =... 阅读全文
posted @ 2013-01-23 15:54 mabel_on_line 阅读(250) 评论(0) 推荐(0) 编辑