Skip to content

About

Responsive JS, media queries for your JS (kind of)

Resources

Stars

4 stars

Watchers

2 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Responsive.js

Responsive.js aids you achieve responsive web design, allowing you to set callbacks between different screen resolutions.

Set functions to execute whenever the window size enters/exits a given range.

For example, you could move the main navigation to the bottom when the screen gets too small.

Example Usage

$.responsive()
  .from(0,500)
    .enter(function(){
      //execute code when the window size is between 0 and 500
    })
    .enter(function(){
      //execute more code when the window size is between 0 and 500
    })
  .from(500,720)
    .enter(function(){
      //execute code when the window size is between 500 and 720
    })
    .exit(function(){
      //execute code when the window size exits this range (ej. screens bigger than 500)
    })

Methods

  • $.responsive()
    Initialize plugin
  • $.responsive().from(from,to,key)
    Sets a range
    • from: min width
    • to: max width
    • key: range name
  • $.responsive().from(from,to).enters(callback)
    Sets a callback to execute when the screen size enters the given range
  • $.responsive().from(from,to).exits(callback)
    Sets a callback to execute when the screen size enters the given range
  • $.responsive().start()
    Starts plugin
  • $.responsive().stop()
    Stop plugin

About

Responsive JS, media queries for your JS (kind of)

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages