Coder Social home page Coder Social logo

magento2-module-enquire-js's Introduction

Magento2 Enquire.js

Add Enquire.js from CDN as a require.js module shim. With fallback to local version when CDN is offline.

Installation

  1. composer require weprovide/magento2-module-enquire-js
    will install the latest version. If you want a specific Enquire.js version you can use this:
    composer require weprovide/magento2-module-enquire-js:<version here>

  2. Run bin/magento setup:upgrade

  3. Run bin/magento setup:static-content:deploy

Available versions

  • 2.1.2
  • 2.1.6

Usage

For usage examples of enquire.js see the enquire.js website

require(['enquire'], function (enquire) {
  enquire.register("screen and (max-width:1000px)", {
  
      match : function() {},      // OPTIONAL
                                  // If supplied, triggered when the media query transitions 
                                  // *from an unmatched to a matched state*
  
      unmatch : function() {},    // OPTIONAL
                                  // If supplied, triggered when the media query transitions 
                                  // *from a matched state to an unmatched state*.
                                  // Also may be called when handler is unregistered (if destroy is not available)
  
      setup : function() {},      // OPTIONAL
                                  // If supplied, triggered once immediately upon registration of the handler
  
      destroy : function() {},    // OPTIONAL
                                  // If supplied, triggered when handler is unregistered. Place cleanup code here
  
      deferSetup : true           // OPTIONAL, defaults to false
                                  // If set to true, defers execution the setup function 
                                  // until the media query is first matched. still triggered just once
  });
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.