Skip to content Skip to sidebar Skip to footer

Set Twitter Bootstrap Popover To Hide After A Certain Event Then Show After Another Event

A user makes a change in a textarea. When this change occurs and another condition is true (in this particular case, the condition is that a text field contains 'yes'), I show a b

Solution 1:

You are binding multiple events of the same type to the popover.

Instead, in your conditional logic you should bind one event if the condition is met or unbind the event if not.

So in your else statement you should have something like:

else {
    $("[rel=next-popover]").popover({
    placement: "right",
    trigger: "manual"
    })
    .off( "mouseenter mouseleave" ).off("click");
}

Fiddle here.

Post a Comment for "Set Twitter Bootstrap Popover To Hide After A Certain Event Then Show After Another Event"