Zoomed/stretched 图像使用 IE11 但不使用 Chrome/Firefox
Zoomed/stretched images with IE11 but not with Chrome/Firefox
Swiper (?) 在 IE11 下显示图像时表现不佳。图像在 Chrome 和 Firefox 上完美呈现。
And you can see this live here
这是代码(就其价值而言,它是 laravel 生成的)
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-car"></i> {{ trans('navs.general.pictures') }}
</div>
<div class="panel-body">
<div class="swiper-container">
<div class="swiper-pagination"></div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
<div class="swiper-wrapper">
@foreach($car->getMedia('vehicules') as $i)
<div class="swiper-slide" style="background-image:url({{ $i->getUrl() }})">
<img data-src="{{ $i->getUrl() }}" src="{{ $i->getUrl() }}" alt="Photo">
</div>
@endforeach
</div>
</div>
</div>
</div><!-- panel -->
</div><!-- col-md-10 -->
</div><!--row-->
@section('after-scripts')
<script src='/js/swiper/swiper.jquery.js'></script>
<script>
$(document).ready(function () {
//initialize swiper when document ready
var mySwiper = new Swiper ('.swiper-container', {
// Optional parameters
pagination: '.swiper-pagination',
paginationClickable: true,
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
})
});
</script>
@stop
@section('before-styles')
<link rel="stylesheet" href="/css/swiper/swiper.css">
<style>
html, body {
position: relative;
height: 100%;
}
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
width: auto;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
</style>
@stop
编辑:
这修复了它:
.swiper-container img {
width: 100%;
}
图片本身有max-width: 100%;
。实际宽度由 .swiper-container .swiper-container-horizontal
定义,但中间有几层 div
和 width: 100%
。
这个问题解决起来可能比理解起来容易。我在 Linux,但我会给出一些猜测。
可能是因为图片没有宽度,IE使用了最大宽度
尝试在图像上定义宽度。
尝试删除最大宽度,and/or将其应用于父项。
Swiper (?) 在 IE11 下显示图像时表现不佳。图像在 Chrome 和 Firefox 上完美呈现。
And you can see this live here
这是代码(就其价值而言,它是 laravel 生成的)
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-car"></i> {{ trans('navs.general.pictures') }}
</div>
<div class="panel-body">
<div class="swiper-container">
<div class="swiper-pagination"></div>
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
<div class="swiper-wrapper">
@foreach($car->getMedia('vehicules') as $i)
<div class="swiper-slide" style="background-image:url({{ $i->getUrl() }})">
<img data-src="{{ $i->getUrl() }}" src="{{ $i->getUrl() }}" alt="Photo">
</div>
@endforeach
</div>
</div>
</div>
</div><!-- panel -->
</div><!-- col-md-10 -->
</div><!--row-->
@section('after-scripts')
<script src='/js/swiper/swiper.jquery.js'></script>
<script>
$(document).ready(function () {
//initialize swiper when document ready
var mySwiper = new Swiper ('.swiper-container', {
// Optional parameters
pagination: '.swiper-pagination',
paginationClickable: true,
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
})
});
</script>
@stop
@section('before-styles')
<link rel="stylesheet" href="/css/swiper/swiper.css">
<style>
html, body {
position: relative;
height: 100%;
}
.swiper-container {
width: 100%;
height: 100%;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
width: auto;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
</style>
@stop
编辑: 这修复了它:
.swiper-container img {
width: 100%;
}
图片本身有max-width: 100%;
。实际宽度由 .swiper-container .swiper-container-horizontal
定义,但中间有几层 div
和 width: 100%
。
这个问题解决起来可能比理解起来容易。我在 Linux,但我会给出一些猜测。
可能是因为图片没有宽度,IE使用了最大宽度
尝试在图像上定义宽度。
尝试删除最大宽度,and/or将其应用于父项。