jquery - Trigger bootstrap tooltip options via javascript -


pls right way pass options via javascript bootstrap tooltip/popover: via data attributes works in:

<input type="text" data-toggle="tooltip" data-placement="right" data-animation="fade" data-delay="200" data-trigger="focus" data-content="foo"> 

but using javascript doesn't:

<script>     jquery(function ($) {         $("input").popover()({             animation:"fade",             delay: "200",             trigger:"focus",             placement: "right"         });     }); </script> 

what right syntax?

for tooltip, should be:

jquery(function ($) {     $("input").tooltip({...}); }); 

instead of:

jquery(function ($) {     $("input").popover({...}); }); 

update: sorry mis-confusions, it works here but:

popover()({...}); 

should

popover({...}); 

html:

<input type="text" data-toggle="tooltip" data-placement="right" data-animation="fade" data-delay="200" data-trigger="focus" data-content="foo"> 

js:

jquery(function ($) {     $("input").popover({         animation:"fade",         delay: "200",         trigger:"focus",         placement: "right"     }); }); 

make sure have added javascript , css files properly.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -