Skip to content

How Eventing

Choose a tag to compare

@Snugug Snugug released this 30 Jul 19:54
· 35 commits to 1.x.x since this release

Custom events have been added, allowing you to add an event listener for eqResize to your element that will fire after a resize event has taken place on it!

(function () {
  'use strict';

  window.addEventListener('DOMContentLoaded', function () {
    var foo = document.getElementById('foo');

    foo.addEventListener('eqResize', function (e) {
      console.log(e);
      if (e.detail && e.detail.indexOf('medium') >= 0) {
        console.log("It's at least medium!");
      }
    });
  });
}());