表格效果

    技术2022-05-20  51

    表格偶数行换色,光标移动着色。

    $(document).ready(function(){

        //光标移动着色

        $(".stripe tr").mouseover(function(){

                $(this).addClass("over");}).mouseout(function(){

                $(this).removeClass("over");})

        //偶数行换色

        $(".stripe tr:even").addClass("alt");

    })

    注:

    1.stripe为table类

    2.JQuery技巧,执行完moveover或moveout之后都会返回当前的对象,所以可以进行链式操作。


    最新回复(0)