0

我的隐藏类不接受切换类:

function overFx (element, classN) {

    if (!element.hasClass('ligado')){

        if (!$.browser.webkit && !$.browser.opera){
            //TR

            element.toggleClass(classN);

        } else {
            //TD

            element.children("td:not(.media)").toggleClass(classN);
        }
    }
}
//EFEITOS PARA DESTACAR LINHAS:

//MOUSE OVER:

$("tr.destacar:not(.hide)").mouseover(function (){

    overFx($(this), "mouseoverTr");
}
);

$(".hide").mouseover(function (){

    overFx($(this), "mouseoverTrHide");
}
);

//MOUSE OUT:

$("tr.destacar:not(.hide)").mouseout(function (){

    overFx($(this), "mouseoverTr");
}
);

$(".hide").mouseover(function (){

    overFx($(this), "mouseoverTrHide");
}
);

我稍后会发布 Jsfiddle。

par 运行良好,$("tr.destacar:not(.hide)")$(".hide")不是,它应该是!他们在那里,我 console.logged 它,$(this)返回正是我想要的。

4

1 回答 1

1

你的$(".hide").mouseout(...)方法有错别字,你有.mouseover(...)

要重新迭代,你有$(".hide").mouseover两次,第二个应该是 a .mouseout

演示:http: //jsfiddle.net/ducYE/

于 2012-05-10T21:41:31.527 回答