Skip to content

Instantly share code, notes, and snippets.

@isralduke
Created November 5, 2015 20:19
Show Gist options
  • Save isralduke/209a321b0082aed13813 to your computer and use it in GitHub Desktop.
Save isralduke/209a321b0082aed13813 to your computer and use it in GitHub Desktop.
Resize Height to Width JS
$(document).ready(function()
{
$(window).resize(function(){
// If there are multiple elements with the same class, "main"
$('.selector').each(function() {
$(this).height($(this).width());
});
}).resize();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment