Search
× Search
mercredi 24 mai 2017
AccueilDraftFeaturesTypographyPopovers

Popovers

Typography

Enter Title

Static popover

Popover top

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

Popover right

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

Popover bottom

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

Popover left

Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.

View Code
<div class="row">
    <div class="col-sm-3">
      <div class="popover top eds_popOverStatic">
  <div class="arrow"></div>
  <h3 class="popover-title">Popover top</h3>
  <div class="popover-content">
    <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
  </div>
</div>
    </div>
    <div class="col-sm-3">
      <div class="popover right eds_popOverStatic">
  <div class="arrow"></div>
  <h3 class="popover-title">Popover right</h3>
  <div class="popover-content">
    <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
  </div>
</div>
    </div>
    <div class="col-sm-3">
      <div class="popover bottom eds_popOverStatic">
  <div class="arrow"></div>
  <h3 class="popover-title">Popover bottom</h3>

  <div class="popover-content">
    <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
  </div>
</div>
    </div>
    <div class="col-sm-3">
      <div class="popover left eds_popOverStatic">
  <div class="arrow"></div>
  <h3 class="popover-title">Popover left</h3>
  <div class="popover-content">
    <p>Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>
  </div>
</div>
    </div>
</div>

Live demo

<button type="button" class="btn btn-lg btn-danger eds_popOver" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">Click to toggle popover</button>

Four directions

<button title="" data-original-title="" type="button" class="btn btn-default eds_popOver" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
        Popover on left
      </button>
      <button title="" data-original-title="" type="button" class="btn btn-default eds_popOver" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
        Popover on top
      </button>
      <button title="" data-original-title="" type="button" class="btn btn-default eds_popOver" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
        Popover on bottom
      </button>
      <button title="" data-original-title="" type="button" class="btn btn-default eds_popOver" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
        Popover on right
      </button>

Dismiss on next click

<button data-content="And here's some amazing content. It's very engaging. Right?" title="" data-toggle="popover" class="btn btn-lg btn-danger eds_popOverDismiss" type="button" data-original-title="Dismissible popover">Dismissible popover</button>

Usage

Enable popovers via JavaScript:

$('#example').popover(options)

Options

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

Name Type Default Description
animation boolean true Apply a CSS fade transition to the popover
container string | false false

Appends the popover to a specific element. Example: container: 'body'. This option is particularly useful in that it allows you to position the popover in the flow of the document near the triggering element - which will prevent the popover from floating away from the triggering element during a window resize.

content string | function ''

Default content value if data-content attribute isn't present.

If a function is given, it will be called with 1 argument, which is the element that the popover is attached to.

delay number | object 0

Delay showing and hiding the popover (ms) - does not apply to manual trigger type

If a number is supplied, delay is applied to both hide/show

Object structure is: delay: { show: 500, hide: 100 }

html boolean false Insert HTML into the popover. If false, jQuery's text method will be used to insert content into the DOM. Use text if you're worried about XSS attacks.
placement string | function 'right' How to position the popover - top | bottom | left | right | auto.
When "auto" is specified, it will dynamically reorient the popover. For example, if placement is "auto left", the popover will display to the left when possible, otherwise it will display right.
selector string false If a selector is provided, popover objects will be delegated to the specified targets. In practice, this is used to enable dynamic HTML content to have popovers added. See this and an informative example.
template string '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'

Base HTML to use when creating the popover.

The popover's title will be injected into the .popover-title.

The popover's content will be injected into the .popover-content.

.arrow will become the popover's arrow.

The outermost wrapper element should have the .popover class.

title string | function '' Default title value if title attribute isn't present
trigger string 'click' How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.
viewport string | object { selector: 'body', padding: 0 }

Keeps the popover within the bounds of this element. Example: viewport: '#viewport' or { selector: '#viewport', padding: 0 }

Methods

$().popover(options)

Initializes popovers for an element collection.

.popover('show')

Reveals an elements popover.

$('#element').popover('show')
.popover('hide')

Hides an elements popover.

$('#element').popover('hide')
.popover('toggle')

Toggles an elements popover.

$('#element').popover('toggle')
.popover('destroy')

Hides and destroys an element's popover.

$('#element').popover('destroy')

Events

Event Type Description
show.bs.popover This event fires immediately when the show instance method is called.
shown.bs.popover This event is fired when the popover has been made visible to the user (will wait for CSS transitions to complete).
hide.bs.popover This event is fired immediately when the hide instance method has been called.
hidden.bs.popover This event is fired when the popover has finished being hidden from the user (will wait for CSS transitions to complete).
$('#myPopover').on('hidden.bs.popover', function () {
  // do something…
})

Ils nous soutiennent

get social

>Qui sommes-nous ?
>La formation
>Être stagiaire
>Espace entreprises partenaires
>Nous rejoindre


Retour au début