简体   繁体   English

工具提示不会隐藏,如果我们在点击时禁用了按钮

[英]Tooltip is not hiding, if we disabled the button on click

Tooltip is not hiding, if we disabled the button on click工具提示不会隐藏,如果我们在点击时禁用了按钮

$("#btn").on("click", function () {
  $(this).prop("disabled", true);
});

here is an running example.这是一个正在运行的例子。 https://jsfiddle.net/JitanGupta/e8fjd0nL/ https://jsfiddle.net/JitanGupta/e8fjd0nL/

I am using basic setup with bootstrap 4我正在使用 bootstrap 4 的基本设置

use hide or show :使用hideshow

        $("#btn").on("click", function () {
            $(this).prop("disabled", true);
             $('[data-toggle="tooltip"]').tooltip('hide');
        });

Just use single line of code for hiding any element tooltip after click.只需使用单行代码在单击后隐藏任何元素工具提示。

$(document).on("click","*[data-toggle='tooltip']",function(){$(this).tooltip('hide');});

The only thing that worked for me is唯一对我有用的是

$("[role='tooltip']").remove()

Removes any tooltip on the page删除页面上的任何工具提示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM