I have a standard HTML form that allows the user to select the Width and Height options (each with values ββfrom 1 to 10). When they submit the form, it submits it to a PHP / HTML page where PHP captures the Width and Height variables and assigns the width and height of the DIV to it.
But what I'm trying to do is just use the Width and Height variables to assign the aspect ratio to this DIV, and then to let the DIV automatically resize to 100% of the container it is in, but while keeping that same format.
Example: A user selects a width of 4 and a height of 2, then submits a form. On the PHP host page, this DIV (the one that receives the width-height relationship) is inside the container, 1000px wide and 600px high. So, now the DIV resizes to 1000 pixels wide and 500 pixels high (this will be an aspect ratio of 4 to 2).
Any ideas, codes, scripts would be extremely useful, thank you very much!
Aaron
source share