BlockUI in IE Bug

本文介绍了一种针对IE8浏览器不支持动态表达式的解决方案。通过使用jQuery库,该方案能够模拟固定定位效果,并确保在IE8环境下网页元素的正确显示。具体实现包括设置元素的位置、高度、宽度等样式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

由于IE8不支持动态表达式。

 

// simulate fixed position
  $.each([lyr1,lyr2,lyr3], function(i,o) {
   var s = o[0].style;
   s.position = 'absolute';
   if (i < 2) {
    full ? s.height=(Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:opts.quirksmodeOffsetHack)) + "px"
      : s.height = o[0].parentNode.offsetHeight + "px";
    full ? s.width=(jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth) + "px"
      : s.width = o[0].parentNode.offsetWidth + "px";
    if (fixL) s.left = fixL;
    if (fixT) s.top = fixT;
   }
   else if (opts.centerY) {
       if (full) s.top = ((document.documentElement.clientHeight || document.body.clientHeight) / 2 - (o[0].offsetHeight / 2) + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop)) + "px";
    s.marginTop = 0;
   }
   else if (!opts.centerY && full) {
    var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0;
    s.top = ((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + top) + "px";
   }
  });

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值