+ -
当前位置:首页 → 问答吧 → 怎样让iframe随下滑菜单自适应改变高度

怎样让iframe随下滑菜单自适应改变高度

时间:2011-10-09

来源:互联网

做了个下滑菜单,为了屏蔽ie6里下拉框等透出浮动层问题,在菜单下滑时同时放其下层了一个iframe(无src),
现在下滑菜单的高度由原来的“固定高度”改成了“根据菜单内容的多少,变化高度。”现在这个起遮挡作用的iframe也得实现根据菜单内容变化高度,即跟滑动层的高度一样,怎么实现?

滑动菜单代码如下:zg_Iframe就是这个iframe
// 点击菜单滑动下拉,焦点不在下滑界面自动回收
  $(document).ready(function () {
  var delayTime = "" ;
  $("#AOPTopMenu>ul>li").hover(function () {
  var _self = $(this).children(".SecondMenuBar");
  delayTime= setTimeout(function () {
  $(_self).slideDown(200)
  $("#zg_Iframe").css('display', 'block');
  }, 600);
  $(this).removeClass("bgColor");
  $(this).addClass("SelectbgColor");
  }, function () {
  clearTimeout(delayTime);
  $(this).children(".SecondMenuBar").slideUp();
  $("#zg_Iframe").css('display', 'none');
  $(this).removeClass("SelectbgColor");
  $(this).addClass("bgColor");
  })
  })




iframe位置:

<div class='containDiv'>
  <div id='AOPTopMenu' class='TopMenuBar'><ul>这里是查出得菜单内容,循环查出</ul></div>
<iframe id='zg_Iframe' name='zg_Iframe' class='maskIframe'></iframe></div>

作者: hdandll   发布时间: 2011-10-09

作者: zsx841021   发布时间: 2011-10-09