angularjs - 如何从禁用按钮中删除工具提示?

标签 angularjs html css

我有一个使用 ng-disabled 禁用的按钮,但该按钮即使在禁用时也显示工具提示,我想在禁用该按钮时删除工具提示。

Here is my Button

<button type="button" class="btn btn-default"
            personinsuranceid="{{row.entity.PersonInsuranceId}}"
            ng-disabled="row.entity.Sequence != 1"
            ng-click="$event.stopPropagation(); grid.appScope.AddPlantoCase(row.entity, 1)"
            data-toggle="tooltip" title="Add as Primary to case">
        1
    </button>

请建议我一种删除工具提示的方法。

最佳答案

工具提示直接从使用操作系统设置的浏览器呈现。因此,使用按钮很难隐藏工具提示。

您可以使用带 ng-click 的 span 来处理调用,并使用 ng-class 来设置样式,而不是按钮。不要忘记检查您的 AddPlantoCase() 是否处于禁用状态,当它为真时什么都不做。

<span class="btn btn-default" 
        personinsuranceid="{{row.entity.PersonInsuranceId}}"
        ng-click="grid.appScope.AddPlantoCase(row.entity, 1)"
        ng-class="{disabled: row.entity.Sequence != 1}"
        data-toggle="tooltip" title="Add as Primary to case">
    1
<span>

/* CSS */
.disabled {
    cursor: not-allowed;
    filter: alpha(opacity=65);
    -webkit-box-shadow: none;
    box-shadow: none;
    opacity: .65;
} 

关于angularjs - 如何从禁用按钮中删除工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39095048/

相关文章:

javascript - Angular js : can't recognize ngTable in Controller

javascript - 如何监视 $scope 变量从 Controller 更改

jQuery 在子文件夹内的菜单上添加类 .active

angularjs - 如何在AngularJS中的同一个元素上嵌套两个指令?

javascript - 在 ng-repeat 中获取对象键

c# - 在 visual studio c# 上启用 tls

javascript - Jquery 验证 div

html - 在单独的 div 中水平对齐元素

iphone - 文本装饰 CSS 在 iPad/iPhone 的 Safari 上被覆盖

html - 设计具有不同值属性和显示文本的下拉列表