1
我必須刪除ui-state-hover類的mouseover並單擊button.I使用jsf的p:commandButton。如何通過使用jQuery刪除ui-state-hover
爲此, 使用jQuery示例代碼:
$("#button").mouseover(function(){
$(this).addClass("btn01");
}, function() {
alert("mouseover working");
$(this).removeClass("ui-state-hover");
});
$("#button").click(function(){
$(this).addClass("btn01");
}, function() {
alert("click not working");
$(this).removeClass("ui-state-hover");
});
使用上面的jQuery,按鈕鼠標懸停時工作正常。 但鼠標點擊按鈕,風格按鈕更改爲ui-state-hover。如何清除ui-state-hover?
你想要什麼到底是什麼?當你在'mouseover'上移除'ui-state-hover'時,當你點擊??時,沒有任何類'ui-state-hover'。因爲它已被刪除。 –