2.0.3 • Published 1 year ago

rwdjs v2.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

rwdjs

Execute JS code from given breakpoints.

Install

npm install rwdjs

Usage

<ol id="log"></ol>
// Get dom element.
const log = document.getElementById('log');

Rwd.init({
  breakpoints: {
    992: {
      name: 'small',
      notName: 'large',
      type: 'max-width',
      match: () => {
        // Matching code.
        log.innerHTML += "<li>Breakpoint reached.</li>";
      },
      else: () => {
        // Breakpoint is not matching.
        log.innerHTML += '<li>Breakpoint not active, execute the "else" code</li>';
      }
    }
  }
});

Changelog

2.0.2

Fix iOS issue with media query syntax.

2.0.0

Init function is now static, Rwd can be executed without create instance.

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago