A paged/tabbed module for the browser
A module for handling paged/tabbed content.
npm install paged
containeris a jQuery element that contains your sections
sectionsis a jQuery set of elements that are the pages/tabs you want to show one at a time
Resets the height of the parent element (useful when the elements change size at different breakpoints)
First, create some HTML like this:
Page 1This is page one!Page 2This is page two!Page 3This is page three!
var Paged = require'paged'tabbedWidget = $'.js-tabbed-widget' $'.js-tabs'children// Init to hide the sections and go to the first tab/pagetabbedWidgetinit// Paged objects inherit from node's EventEmitter classtabbedWidgeton'change'console.log'Page #' + i + ' is now in view'// Show the third tabtabbedWidetgoTo2