New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

paged

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paged

A paged/tabbed module for the browser

latest
npmnpm
Version
0.0.6
Version published
Weekly downloads
7
-70.83%
Maintainers
1
Weekly downloads
 
Created
Source

Paged

A module for handling paged/tabbed content.

npm install paged

Usage

var paged = new Paged(container, sections)

  • container is a jQuery element that contains your sections
  • sections is a jQuery set of elements that are the pages/tabs you want to show one at a time

paged.goTo(i)

Show the ith section

paged.reset()

Resets the height of the parent element (useful when the elements change size at different breakpoints)

Example

First, create some HTML like this:

<div class="js-tabbed-widget">
  <div class="js-tabs">
    <div>
      <h1>Page 1</h1>
      <p>This is page one!</p>
    </div>
    <div>
      <h1>Page 2</h1>
      <p>This is page two!</p>
    </div>
    <div>
      <h1>Page 3</h1>
      <p>This is page three!</p>
    </div>
  </div>
</div>
var Paged = require('paged')
  , tabbedWidget = new Paged($('.js-tabbed-widget'), $('.js-tabs').children())

// Init to hide the sections and go to the first tab/page
tabbedWidget.init()

// Paged objects inherit from node's EventEmitter class
tabbedWidget.on('change', function (i) {
  console.log('Page #' + i + ' is now in view')
})

// Show the third tab
tabbedWidet.goTo(2)

FAQs

Package last updated on 12 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts