簡體   English   中英

在禁用的按鈕上顯示工具提示,如果在一個按鈕上使用AngularJS啟用了工具提示,則將其刪除

[英]display a tooltip on a disabled button and remove it if it is enabled using AngularJS on one button

這是我的代碼:工具提示僅在啟用時顯示。 我需要它反轉。

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" });
 });

disableBtn值為false時,嘗試使用tooltip-enable="!disabledBtn"啟用工具提示。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM