html - Bootstrap Popover works after one click - JavaScript -


i have bootstrap-buttons, should show popover when button clicked.

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

when website has loaded , click button first time, nothing happens. if click second time, popover opens , works normal.

what can popover appear on first click?

in code, first time click on button popover start init only, until second click, see effect,

i'm not sure version popover used. resource have found, using jquery also.

https://github.com/klaas4/jquery.popover/blob/master/demo.html

you can init popover first, , trigger click button want first approach, bind popover directly button

$(function(){     $("[name=usernamel]").popover({trigger: 'click'}); }); 

second appoach, bind popover content div, , show popup button click

$("#divcontent").popover({trigger: 'click'}); $("[name=usernamel]").click(function(){$("#divcontent").trigger('click')}); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -