Skip to content

Instantly share code, notes, and snippets.

@easwee
Created August 12, 2013 11:19
Show Gist options
  • Save easwee/6210023 to your computer and use it in GitHub Desktop.
Save easwee/6210023 to your computer and use it in GitHub Desktop.
Calculate image height by specifying ratio (jQuery sample).
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