jquery.load()使iframe随内容改变而自适应高度

<script type="text/javascript"> <!-- $(function(){ $("#workArea").load(function(){ var height = $(this).contents().find("#box").height() + 40; //这样给以一个最小高度 $(this).height( height < 400 ? 400 : height ); }); }); --> </script>
posted @ 2013-03-20 16:44  二宝的博客  阅读(288)  评论(0编辑  收藏  举报