I have a canvas element with dimensions of 979X482px and I'd like to have it stretch to fit the width of any given browser window, keeping the aspect ratio of width/hight 1 to 1, I want the height to scale relative to width of the canvas. Any suggestions as how to go about doing this with javascript/jQuery?

Calculate the new width and height and apply them via jquery/javascript. There's tons of information out there on how to calc dimensions keeping proportions. Have you tried anything yourself? Some code you're having problems with, maybe?
–
YoshiMay 25 '12 at 7:28

Thanks for this, but I can't seem to get it working. Should $('#canvas').height($('canvas').width() / 2.031); be $('#canvas').height($('#canvas').width() / 2.031);, noting the ID?
–
dcd018May 25 '12 at 7:48