Togglable pages bootstrap.jquery.page.js
Example pages
Click the link below to go to another page.
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:
-
hide.bs.page(on the current active page) -
show.bs.page(on the to-be-shown page) -
hidden.bs.page(on the previous active page, the same one as for thehide.bs.pageevent) -
shown.bs.page(on the newly-active just-shown page, the same one as for theshow.bs.pageevent)
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. |