誰かがこれで私を助けることができます
クリックイベントの要素に別の色を設定しようとしています。
問題は、マウスオーバーイベントによってすべてが再び白くなることです。そのため、active(actief)クラスの色が表示されることはありません。
私は何ができますか、私はすでに行stopeventpropagation()を入れようとしましたか?
ありがとう、リチャード
$("#tbestel_opties2 span").live("mouseover", function() {
$t=$(this);
if(!$t.hasClass('actief')){
$t.css({'color':'#fff','backgroundColor':'#fdc601'});
}
});
$("#tbestel_opties2 span").live("mouseout", function() {
$t=$(this);
if(!$t.hasClass('actief')){
$t.css({'color':'#333','backgroundColor':'#fdc601'}); }
});
$("#tbestel_opties input,#tbestel_opties2 span").live("click", function(e)
{e.stopPropagation();
$t=$(this);
$('#tbestel_opties2 .actief').removeClass("actief").css({'color':'#333'});
$t.addClass("actief")
$("#opties li:eq(0)").addClass("actief");
});