输入[type ="提交"] [已禁用]不适用于IE8

时间:2015-06-10 04:37:01

标签: jquery html css internet-explorer

我的输入提交按钮有3种状态。

  1. 活动:橙色按钮
  2. 鼠标按下:深灰色按钮
  3. 已停用:浅灰色按钮

    <input type="submit" id="savebtn" class="save_button"/>

  4. CSS:

    save_button {
      background: url('/Images/save_button_active.png') no-repeat scroll 0 0 transparent;
      cursor: pointer;
      font-weight: bold;
      font-size: 14px;
      height: 33px;
      padding-bottom: 4px;
      padding-right: 19px;
      width: 216px;
      border: solid 0px;
      color: #fff!important;
      background-position: 0px -30px;
    }
    
    .save_button-active
    {
      background:url('/Images/save_button_mousedown.png') no-repeat scroll 0 0 transparent;
      cursor: pointer;
      font-size:14px;
      font-weight: bold;
      height: 33px;
      padding-bottom: 4px;
      padding-right: 19px;
      width: 216px;
      border:solid 0px;
      color:#fff!important; 
      background-position:0px 2px;
      margin-right:20px\0;
    }
    .save_button[type="submit"]:disabled, .save_button[type="submit"][disabled]
    {
     background:url('/Images/save_button_disabled.png') no-repeat scroll 0 0 transparent;
     cursor: pointer;
     font-size:14px;
     font-weight: bold;
     height: 32px;
     padding-bottom: 4px;
     padding-right: 19px;
     width: 216px;
     border:solid 0px;
     color:#fff!important; 
     background-position:0px 1px;
     margin-right:20px\0;
    }
    

    除了IE8之外,Chrome和其他IE版本都运行良好,第三个禁用状态转为橙色和灰色文本。

    我正在使用jquery添加活动类。

    fnMouseDownEvents(buttonObj, mousedownClass, mouseupClass);
    

    我传递了以下内容:

    fnMouseDownEvents('save_button', 'save_button-active', 'save_button')
    

    我在stackoverflow中搜索各种解决方案,尝试了不同的解决方案,但徒劳无功。

    我在这里错过了什么吗?

1 个答案:

答案 0 :(得分:0)

我只是功能。这就是你想要的吗?

$(".save_button").mouseup(function() {
   $(this).attr("disabled", "disabled");
});

点击jsfiddle

相关问题