jQuery解决iframe高度自适应代码
作者:bea
代码如下: <script type="text/javascript"> <!-- $( function() { //iframe高度随内容自动调整 $('.main').load( function() { $(this).height($(this).contents().find("body").attr('scrollHeight')); } ); } ); // --> </script>
代码如下:
<script type="text/javascript">
<!--
$(
function()
{
//iframe高度随内容自动调整
$('.main').load(
function()
{
$(this).height($(this).contents().find("body").attr('scrollHeight'));
}
);
}
);
// -->
</script>
有用 | 无用
猜你喜欢
您可能感兴趣的文章:
- window.js 主要包含了页面的一些操作
- js 效率组装字符串 StringBuffer
- JS+CSS实现的一种交互体验 表单页面
- javascript 仿开心网好友印象功能(点击文字弹出印象框)
- JavaScript 未知高度元素垂直居中实现代码
- 纯CSS实现的当鼠标移上图片添加阴影效果代码
- Div+Js实现的带阴影菜单 微软以前网站曾用过
- Js倒计时代码,当鼠标离开页面与回到页面会自动停止与开始
- javascript强制弹出新窗口实现代码
- javaScript 删除确认实现方法小结
- jquery 表单取值常用代码
- JavaScript是否可实现多线程 深入理解JavaScript定时机制
- JavaScript 图片预览效果 推荐
- javascript 年月日联动实现核心代码
- 兼容firefox的文本框只能输入两位小数的数字的代码
- js Firefox 加入收藏夹功能代码 兼容Firefox 和 IE
- Javascript和Ajax中文乱码吐血版解决方案
- 利用jQuery的$.event.fix函数统一浏览器event事件处理
- jQuery 连续列表实现代码