在禁用的按钮上显示工具提示,如果在一个按钮上使用AngularJS启用它,则将其删除

时间:2017-04-18 12:25:19

标签: javascript angularjs

这是我的代码:工具提示仅在启用时显示。我需要它反转。

HTML:

<div class="tooltip-wrapper disabled" data-title="testing" uib-tooltip="TESTing" tooltip-enable="disabledBtn">
     <button class="btn btn-primary btn-block" type="button" ng-hide="editMode" ng-click="clickDelete()" ng-model="disabledBtn" ng-disabled="!disabledBtn" ng-style="{'pointer-events':!disabledBtn ? 'none' : ''}">Delete</button>
</div>

CSS:

.tooltip-wrapper {
  display: inline-block; /* display: block works as well */
  margin: 50px; /* make some space so the tooltip is visible */
}enter code here

.tooltip-wrapper .btn[disabled] {
  /* don't let button block mouse events from reaching wrapper */
  pointer-events: none;
}

JS:

 $(function () {
      $('.tooltip-wrapper').tooltip({ position: "bottom" });
 });

1 个答案:

答案 0 :(得分:1)

disabledBtn 值为 false 时,请尝试使用tooltip-enable="!disabledBtn"启用工具提示。