Click on Bootstrap's popover automatically rolled back top issues

Use popover in a link when a link is in the position of the window needs to scroll down and click popover content automatically roll up to the top.

<a tabindex="0" class="btn btn-lg btn-danger" role="button" data-toggle="popover" data-trigger="focus" title="Dismissible popover" data-content="And here's some amazing content.">
  Dismissible popover
</a>

<td>
  <a href='#' data-toggle='popover' data-trigger='focus' data-placement='top' title='这是标题'
    cell - clickable elements>= 'This is what'Content-Data
  </a>
</td>

 

This is actually a href = anchor effect a link in the "#" tag.

有人说:Remove the href="#" tag, it should work.

After removing the href = "#", the page is not sticky, but popover also ineffective. Bootstrap because the popover is packaged in a tag, there are other ways you? It seems there is no official examples are decorated to a button.

Now that we know is href = "#" anchor property caused it easier to handle.

You can solve that by preventing the default action of the anchor element.

$('a').on('click', function(e) {
    e.preventDefault(); 
    return true;
});

 Such a link would not jump up.

Guess you like

Origin www.cnblogs.com/monsino/p/11465292.html