我有一个工具提示,但它无法在单击按钮时隐藏。
这是我的按钮:
<button class="btn btn-outline-inverse ajax_addtocart additems
data-toggle="tooltip" title="Add to cart"
id="<?php echo $item->id ?>">
<i class="fa fa-shopping-cart"></i>
<span class="select_options">Add to cart</span>
</button>
这是点击按钮:
$("button.additems").click(function(e){ //user clicks form submit button
e.preventDefault();
var button = $(this);
var form_data = $(this).attr("id"); //prepare form data for Ajax post
button.prop('disabled', true); //Loading button text //change button text
.............. Continues to do ajax after ajax request
button.prop('disabled', false)
工具提示保持显示状态。
我试过添加
button.tooltip('hide') //this also fails
我也试过this和
最佳答案
关于javascript - 在 jquery 中隐藏单击按钮时的工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41226379/