zoukankan      html  css  js  c++  java
  • jquery表格简单插件

    1、一直对jquery插件感觉非常神奇。今天动手写了一个超级简单的案例。

    2、效果

    3、体会

    a、jquery插件编写能力。

    须要具备一定js能力的编写。还有写css样式的运用;希望以后这方面会有提高。

    b、能封装插件尽量封装。

    c、面向对象的方式去写对象。

    4、代码

    /**
     * Created by Administrator on 2015/8/17 0017.
     */
    (function ($) {
        $.fn.tableUI = function (options) {
            var defalus = {
                evenRowClass: "evenRow",
                oddClass: "oddRow",
                activeRowClass: "activeRow"
            }
            var options = $.extend(defalus, options);
            // do somethings
            this.each(function () {
                var thisTable = $(this);
                //加入奇偶行颜色
                $(thisTable).find("tr:even").addClass(options.evenRowClass);
                $(thisTable).find("tr:odd").addClass(options.oddClass);
                //加入活动行颜色
                $(thisTable).find("tr").bind("mouseover", function () {
                    $(this).addClass(options.activeRowClass);
                });
                $(thisTable).find("tr").bind("mouseout", function () {
                    $(this).removeClass(options.activeRowClass);
                });
            });
        }
    })(jQuery);

    5、源码

    http://download.csdn.net/detail/u011431550/9016657

  • 相关阅读:
    12、SpringBoot-CRUD增加数据
    12、SpringBoot-CRUD增加数据
    Cache操作类
    pythonhttp
    python学习
    自动化测试LoadRunner
    pythonweb自动化测试
    python学习工具篇
    python学习
    自动化测试之python安装
  • 原文地址:https://www.cnblogs.com/yjbjingcha/p/6971528.html
Copyright © 2011-2022 走看看