<script type="text/javascript">
//光标移动到顶部
this.to_top=function(){
$("html,body").animate({scrollTop:0}, 500);
} this.setCwinHeight=function (iframeObj) { /* 8、获取iframe的高度
iframe.contentWindow.document.body.offsetHeight;
如果要获取iframe中的iframe
document.getElementById('iframId').onload=function(){
var html= window.frames["name属性"].frames["name属性"].document.getElementById('iframe中的元素的id').innerHTML; $('#iframeId').load(function() { //方法1
var iframeHeight = Math.min(iframe.contentWindow.window.document.documentElement.scrollHeight, iframe.contentWindow.window.document.body.scrollHeight);
var h=$(this).contents().height();
$(this).height(h+'px');
});
*/
if (document.getElementById) {
if (iframeObj && !window.opera) {
if (iframeObj.contentDocument
&& iframeObj.contentDocument.body.offsetHeight) {
if (a = iframeObj.getAttribute("id") == "video_top") {
iframeObj.height = iframeObj.contentWindow.document.body.offsetHeight;
} else if (iframeObj.getAttribute("id") == "video_bottom") {
iframeObj.height = iframeObj.contentWindow.document.body.offsetHeight;
} else if (document.frames[0].contentWindow
&& document.frames[0].contentWindow.document.body.scrollHeight) {
var height = document.frames[0].document.body.scrollHeight;
}
}
}
}
}
</script>
//src为子frame间接路径
<iframe id="video_bottom" src="${pageContext.request.contextPath}/vcomment/videoBottom/${videoId}.htm" width="90%" frameborder="0" scrolling="no" onload="setCwinHeight(this);"></iframe>

  

最新文章

  1. Linux.NET学习手记(6)
  2. JavaScript语言精粹--Function,类,this,对象
  3. bzoj3668: [Noi2014]起床困难综合症
  4. Qt4.8.6+mingw+Qgis2.4.0基于QGis的二次开发
  5. spring quartz 定时任务“Failed to load class &quot;org.slf4j.impl.StaticLoggerBinder”“Checking for available updated version of Quartz”
  6. Marzoni(玛佐尼)意大利顶级西服面料之一_HollandandSherry_新浪博客
  7. css案例学习之id要唯一
  8. git ssh认证
  9. 梳排序(Comb sort)
  10. MapReduce深度分析(一)
  11. TF.VARIABLE、TF.GET_VARIABLE、TF.VARIABLE_SCOPE以及TF.NAME_SCOPE关系
  12. undo系统参数详解
  13. python_装饰器
  14. python全栈开发day86-CRM增删改查 分页
  15. xmlSpy套件(Altova MissionKit 2016)的Ollydbg调试过程及破解
  16. 学习windows编程 day4 之 多边矩形填充
  17. (ecj)Eclipse的Java编译器分析之一——ecj介绍
  18. django后台的制作
  19. tomcat8 tomcat-users相关配置
  20. How to turn on syntax highlighting in osx

热门文章

  1. 一、core 启动设置文件中的错误(启动文件不存在)
  2. Qualcomm_Mobile_OpenCL.pdf 翻译-8-kernel性能优化
  3. Qt常见错误
  4. 使用Spring MVC统一异常处理实战(转载)
  5. curl检查访问网页返回的状态码
  6. float浮动导致父元素高度坍塌的原因及清除浮动方法
  7. spark读取kafka数据 createStream和createDirectStream的区别
  8. linq 分页
  9. protocol buffer第一篇:语法介绍
  10. mysql AUTO INCREMENT字段 语法