Created
August 12, 2013 11:19
-
-
Save easwee/6210023 to your computer and use it in GitHub Desktop.
Calculate image height by specifying ratio (jQuery sample).
This file contains hidden or 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
var rW = 1600; | |
var rH = 650; | |
var contW = $(window).width(); //set the element from which to calculate your width | |
var newH = (rH * contW) / rW; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment