Created
November 5, 2015 20:19
-
-
Save isralduke/209a321b0082aed13813 to your computer and use it in GitHub Desktop.
Resize Height to Width JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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