user2755667
user2755667

Reputation:

Tooltip on click

I'm not sure what I'm doing wrong here it seems like this is what they say to do in the docs if I want to use just HTML to set a tooltip trigger but it only works on hover.

<div class='sample' data-trigger="click" data-toggle="tooltip" title="you clicked!">     </div>

heres my jsbin as well

also from the docs:

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, as in data-animation="".

Upvotes: 0

Views: 38

Answers (1)

Dan
Dan

Reputation: 9468

HTML

<div class="sample" data-toggle="tooltip" data-placement="right" title="you clicked!"> </div>

JS

$("[data-toggle=tooltip]").tooltip({trigger:'click'});

No change to your CSS

Bootply Demo

Upvotes: 1

Related Questions