別の から を取得してheight
のを変更しようとしていますが、エラーが発生しています。div
height
div
Cannot set property 'height' of undefined
コード:
$("#loading_image_container").style.height = $('#content_frame').height();
content_frame の高さは 500px だと思います。
別の から を取得してheight
のを変更しようとしていますが、エラーが発生しています。div
height
div
Cannot set property 'height' of undefined
コード:
$("#loading_image_container").style.height = $('#content_frame').height();
content_frame の高さは 500px だと思います。
試す
$("#loading_image_container").height($('#content_frame').height());
DOM 要素ではなく、jQuery オブジェクトを参照しているためです。組み込みの jQuery 関数を次のように使用します。
$("#loading_image_container").height($('#content_frame').height());
または、最初に DOM 要素を取得します。
$("#loading_image_container")[0].style.height = $('#content_frame').height();
style
jQuery オブジェクトのを設定しようとしています。CSS を使用してください
$("#loading_image_container").css("height", $('#content_frame').height());
または:
$("#loading_image_container")[0].style.height = $('#content_frame').height();
これを試して :
$(".div1").css({'height':($(".div2").height()+'px')});
正しい式で .style を見逃しているかもしれません: 試してみてください
$("#loading_image_container").style.height = $('#content_frame').style.height;