【发布时间】:2015-04-16 05:28:44
【问题描述】:
我目前正在开发一个网站,当然,它也需要响应式。一切都在 iOS 和 Android 上正常工作,除了他没有在 Android 的幻灯片中显示三个特定图像(在三星 S5、S3、Galaxy Tab 3 / Lollipop、Jelly Bean / 默认浏览器,Chrome)。他确实显示了其余的图像。
我正在通过 JS 将这些图像添加为右侧 div 的背景图像:
$('.header__slideshow--frame').each(function (index) {
$(this).css({
'width': slider.parts.header.width(),
'background-image': 'url(' + (dir + slider.images.links[index]) + ')'
});
});
框架的样式在哪里:
.header__slideshow {
position: relative;
overflow: hidden;
left: 0;
height: 102%;
z-index: -1000;
margin-top: -15em;
background: $greyOne url('../images/slider-placeholder.png') no-repeat center 35%;
.header__slideshow--frame {
float: left;
height: 100%;
background-repeat: no-repeat;
background-position: bottom center;
background-size: cover;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
}
}
所有图片均为 .jpg 格式,不大于 260KB,最大宽度为 1600px,如果我直接通过浏览器打开它们,就会显示它们。
我已经尝试更改图像的 (max-)height、(max-)width、位置、z-index、完整路径,将它们添加为 .png,删除背景“cover”属性等等。
有没有人对调试这类问题有任何想法、建议或技巧?
提前致谢!
【问题讨论】:
-
检查图像的路径是否正确,一种方法是尝试在计算机浏览器而不是手机上加载页面。查看 LogCat 调试信息,看看是否有任何异常被抛出,例如内存不足异常。
-
感谢您的回答 - 我确信路径是正确的,我一定会尝试使用 LogCat 信息进行调试。但仍然很奇怪,他将它们加载到所有 iOS 设备上,而不是 Android 设备上 - 对吧?是否也与 CSS 相关?