JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q29287F
  • License MIT

Execute JS code from given breakpoints.

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rwdjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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.