首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IE11高程问题

IE11高程问题
EN

Stack Overflow用户
提问于 2018-09-12 10:03:24
回答 1查看 148关注 0票数 0

我正试图将image1的高度分配给图像2,在边缘、Chrome和Firefox中工作得很好。IE11不工作,也没有错误消息。这是它在Edge、Chrome和Firefox中的样子:没有问题:

在IE11: IE11发行版中:

代码语言:javascript
复制
function setIntHeight() {
    var g1 = $('.grid-tile').eq(0),
        h = g1.find('img').height();
    $('.interruptor1, .interruptor2').height(h);
}

function interruptorHeight() {
    $(window).on('load', setIntHeight);
    $(window).on('resize', debounce(setIntHeight));
}

interruptorHeight();
代码语言:javascript
复制
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<!--Image 1-->
<li class="grid-tile">
<div class="product-tile" >
<div class="product-image">
<img src="https://development-na01-arden.demandware.net/dw/image/v2/BBVB_DEV/on/demandware.static/-/Sites-master-catalog/default/dwf7e4c6a8/images/large/8B-AP04151-cc521986-d8f4-4c81-b43a-787622068cba.jpg?sw=265&amp;sh=398&amp;sm=fit" alt="PLUS Blessed Tee">
</div>
</div>
</li>

<!--Image 2-->
<li class="bg-image grid-tile interruptor1">
  <img  src="https://development-na01-arden.demandware.net/on/demandware.static/-/Sites-ardene-Library/default/dwb58b67e0/homepage/MasonryImage5.jpg" alt="PLUS Blessed Tee" >
</li>

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-16 17:43:56

$(window).on('load',setIntHeight);在IE11中不能正常工作。请尝试使用:

代码语言:javascript
复制
window.onload = function() {
    setIntHeight();
};

网站上有很多解释,到处都是研究。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52292559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档