Jquery如何移除ui-state-hover

jquery how to remove ui-state-hover

本文关键字:ui-state-hover 何移 Jquery      更新时间:2023-09-26

我使用的jquery代码:

<script type="text/javascript">
  $("#dform").dialog({
    autoOpen: false,
    modal: true,
    buttons: {
      'Submit': {
        text : "Submit",
        class : "gbutton",
        click: function () {
          ...
        }
      },
      'Cancel': {
        text : 'Cancel',
        class : 'gbutton',
        click: function () {
          ...
        }
      }
    }
  });
  $("a")
    .click(function(event) {
        $("#dform").dialog("open");
        $('button').removeClass("ui-button");
        $('button').removeClass("ui-widget");
        ....
        $('button').removeClass("ui-state-hover");
      }
  });
</script>

但是鼠标悬停在按钮上,按钮样式更改为ui-state-hover。如何删除ui-state-hover?我希望ui-state-hover是添加jquery代码,但我不知道如何关闭它

我找到了解决方案

  $("button").mouseover(function() {
    $(this).removeClass("ui-state-hover");
  });