Hi i need a script to check a div size constantly, automatically resizing the div height to sustain the aspect ratio (3.2) when a window is resized.
Here is what I came up with for jQuery, but I am not sure how to get it to work. The initial size would be 640x200px.
/* this is meant to use aspect ratio for slideshow height */
$('#myDiv').css({'height' : $('#slideshow').width()/3.2});
If anyone could give me a JSfiddle/Codepen example that'd be great!