Togglable pages bootstrap.jquery.page.js

Example pages

Click the link below to go to another page.

Page One

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui. Click here to go to page two.

Page Two

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park. Click here to go to page three.

Page Three

Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr. Click here to go to page one.

Static Popover

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

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

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

Usage

Enable togglable pages via JavaScript:

Markup

You can activate a page navigation without writing any JavaScript by simply specifying data-toggle="page" on an element. Page toggles may be placed within page container.

Methods

.page()

Activates a page content container. Page toggler should have a data-target targeting a page node in the DOM. In the above examples, the page togglers are the <a>s with data-toggle="page" attributes.

.page('show')

Selects the given page and shows its associated content. Any other pages that was previously selected becomes unselected and its associated content is hidden.

Events

When showing a new page, the events fire in the following order:

  1. hide.bs.page (on the current active page)
  2. show.bs.page (on the to-be-shown page)
  3. hidden.bs.page (on the previous active page, the same one as for the hide.bs.page event)
  4. shown.bs.page (on the newly-active just-shown page, the same one as for the show.bs.page event)

If no page was already active, then the hide.bs.page and hidden.bs.page events will not be fired.

Event Type Description
show.bs.page This event fires on page show, but before the new page has been shown. Use event.target and event.relatedTarget to target the active page and the previous active page (if available) respectively.
shown.bs.page This event fires on page show after a page has been shown. Use event.target and event.relatedTarget to target the active page and the previous active page (if available) respectively.
hide.bs.page This event fires when a new page is to be shown (and thus the previous active page is to be hidden). Use event.target and event.relatedTarget to target the current active page and the new soon-to-be-active page, respectively.
hidden.bs.page This event fires after a new page is shown (and thus the previous active page is hidden). Use event.target and event.relatedTarget to target the previous active page and the new active page, respectively.