npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

light-responsive-js

v1.0.0

Published

The Light Responsive JS is a lightweight web responsive library written by JavaScript. It is easy to use and configure. Just call once and add the responsive configurations via the convention attributes and then call the responsive.

Readme

Light Responsive JS

The Light Responsive JS is a cross-browser lightweight web responsive library written by JavaScript. It is easy to use and configure. Just add the responsive configurations via the convention attributes into the HTML DOM and then call the responsive.

It lets you build the front-end website which supports the responsive easier than. You can add any responsive support on any the HTML DOM which you want. Because the responsive is programmatically called, you can control any logic before/after it.

To get started, please download the stable release version at here.

Table Of Contents

Installation

Four quick start options are available:

  • Download the latest release.
  • Clone the repository: git clone https://github.com/phatly27/light-responsive-js.git
  • Install npm: npm install light-responsive-js
  • Install bower: bower install light-responsive-js

Usage

You only need to include light-responsive.js after jQuery. Requires the jQuery 1.4.+

<script src="jquery.js"></script>
<script src="light-responsive.js"></script>

Documentation

You just do simple in three steps to implement the web responsive for your website using the Light Responsive:

  • Add the library as the usage part.
  • Add the media query attribute into DOM element.
<div class='header' mq-range-width-481px-768px-add-class='header-mobile'></div>
  • Call the responsive.
// Responsive all elements that have the 'header' class
// This says that if your current window width is between
// 481px and 768px(>=481px and <=768px), the .header element
// will be added a new class '.header-mobile'
$('.header').responsive();

This library consists of six following convention media query configuration attributes to define the responsive:

Media query attribute name | Description -------------------------- | ----------- mq-min-width-{min-width-pixel}-add-class | If your current window width >= {min-width-pixel}, then add class(es) into the DOM element. mq-min-width-{min-width-pixel}-remove-class | If your current window width >= {min-width-pixel}, then remove class(es) into the DOM element. mq-max-width-{max-width-pixel}-add-class | If your current window width <= {max-width-pixel}, then add class(es) into the DOM element. mq-max-width-{max-width-pixel}-remove-class | If your current window width <= {max-width-pixel}, then remove class(es) into the DOM element. mq-range-width-{min-width-pixel}-{max-width-pixel}-add-class | If your current window width >= {min-width-pixel} and <= {max-width-pixel}, then add class(es) into the DOM element. mq-range-width-{min-width-pixel}-{max-width-pixel}-remove-class | If your current window width >= {min-width-pixel} and <= {max-width-pixel}, then remove class(es) into the DOM element.

#####For examples: mq-min-width-{min-width-pixel}-add-class:

<!-- Add the single class -->
<div class='header' mq-min-width-481px-add-class='header-desktop'></div>
<!-- Add the multiple classes -->
<div class='header' mq-min-width-481px-add-class='header-tablet, header-desktop'></div>

mq-min-width-{min-width-pixel}-remove-class:

<!-- Remove the single class -->
<div class='header header-mobile' mq-min-width-481px-remove-class='header-mobile'></div>
<!-- Remove the multiple classes -->
<div class='header header-mobile-1 header-mobile-2' mq-min-width-481px-remove-class='header-mobile-1, header-mobile-2'></div>

mq-max-width-{max-width-pixel}-add-class:

<!-- Add the single class -->
<div class='header' mq-max-width-480px-add-class='header-mobile'></div>
<!-- Add the multiple classes -->
<div class='header' mq-max-width-480px-add-class='header-mobile-1, header-mobile-2'></div>

mq-max-width-{max-width-pixel}-remove-class:

<!-- Remove the single class -->
<div class='header header-desktop' mq-max-width-480px-remove-class='header-desktop'></div>
<!-- Remove the multiple classes -->
<div class='header header-desktop-1 header-desktop-2' mq-max-width-480px-remove-class='header-desktop-1, header-desktop-2'></div>

mq-range-width-{min-width-pixel}-{max-width-pixel}-add-class:

<!-- Add the single class -->
<div class='header' mq-range-width-481px-768px-add-class='header-tablet'></div>
<!-- Add the multiple classes -->
<div class='header' mq-range-width-480px-768px-add-class='header-tablet-1, header-tablet-2'></div>

mq-range-width-{min-width-pixel}-{max-width-pixel}-remove-class:

<!-- Remove the single class -->
<div class='header header-desktop' mq-range-width-481px-768px-remove-class='header-desktop'></div>
<!-- Remove the multiple classes -->
<div class='header header-mobile header-desktop' mq-max-width-481px-768px-remove-class='header-mobile, header-desktop'></div>

You have to call the responsive function after to be defined. This function accepts an object with 3 parameters:

  • ele: this is jQuery element. Default is $('*')
  • autoRun: auto run the responsive after to be initialized. Default is true.
  • transition: animate the CSS3 transition. Default is all 0.3s ease-in-out

#####For examples:

$('*').responsive(); // Implement the responsive for all DOM elements
$('.header').responsive(); // Implement the responsive for the elements that have the '.header' class
$('.header, .content').responsive(); // Implement the responsive for the elements that have the '.header' or '.content' class

Browser Support

This library supports almost all modern browsers:

  • IE6+.
  • Firefox 3.5+.
  • Google Chrome.
  • Safari 5.1+.
  • Opera.

Bugs and Feature Requests

Have a bug or a feature request? If your problem or idea is not addressed yet, please open a new issue.

Copyright and License

Copyright 2015 by Phat Ly released under the MIT license