87,907
社区成员
发帖
与我相关
我的任务
分享
(function($){
$.fn.face=function(options)
{
var defaults = {
"ID":"content"
};
options = $.extend(defaults,options);
$(this).click(function(e){
//每次我都把那些事件都写在里面,长的话就一大堆,可读性不怎么好,该怎么改呢
//一般大家都砸写的呢?
//....
$("#maindiv li").mouseover(function(e){
//....
());
}).bind("click",function(event){
//....
})
})
}
})(jQuery);
(function ($) {
$.a = {
fna: function (p) {
},
fnb:function(pa,pb){
}
};
$.extend($.a);
})(jQuery);
//实现鼠标经过表格行时高亮,调用方法为:$.handleTableUI("table_content_list");
; (function ($) {
$.extend({
handleTableUI: function (table) {
var thisTable = $("#" + table);
$(thisTable).find("tr").bind("mouseover", function () {
$(this).css({ color: "#ff0011", background: "blue" });
});
$(thisTable).find("tr").bind("mouseout", function () {
$(this).css({ color: "#000000", background: "white" });
});
}
});
})(jQuery);
//实现鼠标经过表格行时高亮,调用方法为:$("#table_content_list").setTableUI();
; (function ($) {
$.fn.setTableUI = function (options) {
var defaults = {
evenRowClass: "evenRow",
oddRowClass: "oddRow",
activeRowClass: "activeRow"
}
var options = $.extend(defaults, options);
this.each(function () {
var thisTable = $(this);
$(thisTable).find("tr").bind("mouseover", function () {
$(this).css({ color: "#ff0011", background: "blue" });
});
$(thisTable).find("tr").bind("mouseout", function () {
$(this).css({ color: "#000000", background: "white" });
});
});
};
})(jQuery);
//实现鼠标经过表格行时高亮,该方法自行调用
; (function ($) {
$.tableUI = { set: function () {
var thisTable = $("table");
$(thisTable).find("tr").bind("mouseover", function () {
$(this).css({ color: "#ff0011", background: "blue" });
});
$(thisTable).find("tr").bind("mouseout", function () {
$(this).css({ color: "#000000", background: "white" });
});
}
};
//此处进行自调用
$(function () {
$.tableUI.set();
});
})(jQuery);