CodyKochmann
6/22/2016 - 3:25 PM

js script to set the height of an element to the width of an element (and vice versa) based on its currently rendered client rectangle

js script to set the height of an element to the width of an element (and vice versa) based on its currently rendered client rectangle

// Generated by CoffeeScript 1.10.0
(function() {
  var run_height_eq_width, run_width_eq_height;

  run_width_eq_height = function(dom) {
    dom.style.width = dom.getBoundingClientRect().height.toString() + "px";
    return true;
  };

  window.width_eq_height = function(dom) {
    setInterval(run_width_eq_height, 250, dom);
    return true;
  };

  run_height_eq_width = function(dom) {
    dom.style.height = dom.getBoundingClientRect().width.toString() + "px";
    return true;
  };

  window.height_eq_width = function(dom) {
    setInterval(run_height_eq_width, 250, dom);
    return true;
  };

}).call(this);
run_width_eq_height=( dom )->
    dom.style.width = dom.getBoundingClientRect().height.toString()+"px"
    true

window.width_eq_height=(dom)->
    setInterval(run_width_eq_height,250,dom)
    true

run_height_eq_width=( dom )->
    dom.style.height = dom.getBoundingClientRect().width.toString()+"px"
    true

window.height_eq_width=(dom)->
    setInterval(run_height_eq_width,250,dom)
    true