简体   繁体   English

jQuery加载页面,页面内容具有自动高度

[英]jQuery load page with auto height on content

i am using this jQuery to load my content into a div. 我正在使用此jQuery将我的内容加载到div中。 How can i replace to 1000px height in the object into auto? 如何将对象中的1000px高度替换为auto? So when it loads, it re-sizes into the correct size? 因此,在加载时,它会重新调整为正确的尺寸吗?

 <div id="siteloader" style="width: 100%; height:auto;"></div>​
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script>
  $("#siteloader").html('<object data="content.html" style="width: 100%; height:1000px;">');
</script>
<script type="text/javascript" >
   $(window).load(function() {
       $("#siteloader").html('<object data="content.html" style="width: 100%; height:1000px;">');

   });
 </script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM