Can I use this code to set the height of two elements in jQuery?
I w开发者_开发问答ant to set both #map_canvas
and #content
's height, but this doesn't seem to work:
$(['#map_canvas','#content']).css("height", ($(window).height()-270 + "px"));
Does anybody know how to do this?
Try this:
$('#map_canvas, #content').height(window.height-270);
I do something similar with google earth integration on a current project...
Try (you kinda have extra parentesis in there):
$(['#map_canvas','#content']).css("height", $(window).height()-270 + "px");
jQuery("#map_canvas,#content").css("height", (jQuery(window).height() - 270 ) + "px");
精彩评论