开发者

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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜