Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdcauley/f35efd70f8934327114a to your computer and use it in GitHub Desktop.
Save jdcauley/f35efd70f8934327114a to your computer and use it in GitHub Desktop.
Boxer - Make Height = Width
window.onload = boxer;
window.onresize = boxer;
function boxer(){
var cols = document.getElementsByClassName('col');
for (var i = 0; i < cols.length; i++){
var style = window.getComputedStyle(cols[i], null).getPropertyValue('width');
cols[i].style.height=style;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment