Bootstrap Popover只需点击一下即可使用 - JavaScript [英] Bootstrap Popover works after one click - JavaScript

查看:74
本文介绍了Bootstrap Popover只需点击一下即可使用 - JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have some Bootstrap-Buttons, which should show a popover when the button is clicked.

我有一些Bootstrap按钮,当按钮被点击时应该显示弹出窗口。 (e){
$(#+ e.currentTarget.id).popover({html:true});
}

usernameL.onclick = function(e){ $("#" + e.currentTarget.id).popover({html : true}); }

当网站加载并且我第一次点击按钮时,没有任何反应。如果我再次点击,弹出窗口会打开并且正常工作。

When the website has loaded and I click the button a first time, nothing happens. If I click a second time, the popover opens and it works normal.

弹出窗口出现在第一次点击上我能做些什么?

What can I do for the popover to appear on the first click?

推荐答案

这是怎么回事?

What about this?

usernameL.onclick = function(e){
   $("#" + e.currentTarget.id).popover({html : true}).popover('show');
}

这篇关于Bootstrap Popover只需点击一下即可使用 - JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆