码迷,mamicode.com
首页 > 其他好文 > 详细

iframe 自适应浏览器高度

时间:2015-06-19 16:43:10      阅读:119      评论:0      收藏:0      [点我收藏+]

标签:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="js/jquery1.6.2.js"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<BODY style="overflow-y: hidden;margin:0px; padding:0px;">
<div id="sou" style="height:77px">
<ul>
<li style=" width:30px; margin-top:22px"><a href="#" class="page"><img src="img/but02.png" width="17" height="24" border="0"></a></li>
<li style=" width:30px; margin-top:22px"><img src="img/but03.png" width="17" height="24" /></li>
<li style=" width:45px"><img src="img/home.png" /></li>
<li style=" width:5px"><img src="img/sou_left.gif" /></li>
<li style="width:60%">
<input type="text" class="sou-li-input" value="请输入要抓取产品的网址" onfocus="if (value ==‘请输入要抓取产品的网址‘){value =‘‘}" onblur="if (value ==‘‘){value=‘请输入要抓取产品的网址‘}" />
</li>
<li style=" width:5px"><img src="img/sou_right.gif" /></li>
<li style=" width:50px; text-align:center"><img src="img/but04.png" width="38" height="38"/></li>
<li style=" width:134px"><img src="img/but05.png" /></li>
</ul>
</div>
<div id="goods_box_wrapper" style=" margin:auto; margin-top:1px">
<iframe id="goods_box" frameborder="0" width="100%" height="100%" border="0" src="http://www.alibaba.com" ></iframe>
</div>
<script type="text/javascript">
$(function () {
var flag = false;
$(‘#open‘).click(function () {
var $side = $(‘#fix_bar‘);
if (!flag) {
$side.animate({ ‘left‘: 0 });
flag = true;
} else {
$side.animate({ ‘left‘: -280 });
flag = false;
}
});
});
reheight();
$(window).resize(reheight);
function reheight() {
var height = $(window).height();
if ($.browser.msie) {
height = height - 100;
} else {
height = height - 120;
}
$("#goods_box").height(height);
}
</script>
</html>

 

 

js下载地址:http://files.cnblogs.com/files/robt/jquery1.6.2.js

iframe 自适应浏览器高度

标签:

原文地址:http://www.cnblogs.com/robt/p/4589048.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!