【问题标题】:'background-size:cover' does not work in ipad“背景尺寸:封面”在 ipad 中不起作用
【发布时间】:2014-11-19 06:34:06
【问题描述】:

您好,我正在尝试创建视差站点。我的代码在每个浏览器中都运行良好。但是我在ipad上遇到了一些问题。在 ipad background-size: cover 中不起作用。

这是我的代码:

$(document).ready(function(){
  $('section[data-type="background"]').each(function(){
    var $bgobj = $(this); // assigning the object
    $(window).scroll(function() {

      // Put together our final background position

      var yPos = -($window.scrollTop() / $bgobj.data('speed'));
      var coords = '50% '+ yPos + 'px';

      // Move the background
      $bgobj.css({ backgroundPosition: coords });

    });
  });
});
#section1 {
  background: url(images/hlfs-image.jpg) 0% 0% no-repeat fixed; 
  min-height: 1000px ;
  height: 1000px ;
  margin: 0 auto ;
  width: 100%;
  max-width: 1920px ;
  position: relative ;
  background-size:cover ;

}
 <section id="section1" data-type="background" data-speed="10" class="pages"> </section>

谁能给我一个解决办法

输出

【问题讨论】:

    标签: html ios css ipad


    【解决方案1】:

    尝试使用

     #section1 {
          background: url(images/hlfs-image.jpg) 0% 0% no-repeat fixed; min-height: 1000px !important;
      height: 1000px !important;
      margin: 0 auto !important;
      width: 100%;
      max-width: 1920px !important;
      position: relative !important;
      background-size:cover !important;
      -webkit-background-size: cover;
    
    }
    

    我的正在处理这个..

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-07
      • 1970-01-01
      • 2014-07-29
      • 2016-02-26
      • 1970-01-01
      相关资源
      最近更新 更多