为什么不(纯CSS)Parallax Scrolling在Chrome中正常工作? (幻灯片#2背景错误)

时间:2015-09-05 18:35:01

标签: html css google-chrome parallax infinite-scroll

它在IExplorer,FF,Opera,Safari上运行得非常好,甚至HTML Validator也没有任何错误或警告......我现在完全无助:(

有问题的网站:http://www.ubiikki.net

正如您所看到的,在第二张幻灯片中,背景错误并传播到幻灯片3,没有显示该幻灯片的正确背景,就像在所有其他浏览器上一样。

-

我使用的代码(幻灯片2 =此代码中的slide1因为实际的slide1只是幻灯片):

HTML:

<div id="slide1" class="slide">

  <div class="title">
    <h1 class="black">UBI</h1>
    <p>...</p>
  </div>

  </div>


<div id="slide2" class="slide">

  <div class="title">
    <h1 class="black">UBIK LIST</h1>

    <div id="vasen" class="black">
    List A:<br />
<ul><li>Ubique</li>
<li>Ubique 2</li>
</ul></div>

<div id="oikea" class="black">
List B:<br />
<ul><li>
Ubique</li>
<li>UbiqueUbique</li>
</ul>
</div>

<div>
    <div style="float: left;"></div>
    <div style="clear: both;"></div> <!-- Clear the float -->
</div>

    </div>


</div>

CSS:

html {
  height: 100%;
  overflow: hidden;
}

body { 

    font-family: 'Josefin Sans', sans-serif;
  margin:0;
  padding:0;
    perspective: 1px;
    transform-style: preserve-3d;
  height: 100%;
  overflow-y: scroll;
  overflow-x: hidden;

  background-color:#000;
    color:#fff;

}

.slide {
  position: relative;
  padding: 25vh 10% 25vh 10%;
  min-height: 100vh;
  width: 100vw;
  box-sizing: border-box;
  box-shadow: 0 -.0625em .225em rgba(0, 0, 0, .5);
    transform-style: inherit;
}

.slide:before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left:0;
  right:0;
}

.title {
  width: 50%;
  padding: 5%;
  border-radius: 0.125em;
  background: rgba(240,230,220, .7);
  box-shadow: 0 0 0.5em rgba(0, 0, 0, .7);
}

.slide:nth-child(2n) .title {

 margin-left: auto;
  margin-right: 0;

}

.slide:nth-child(2n+1) .title {

   margin-left: 0;
  margin-right: auto;


}

.slide, .slide:before {
  background: 50% 50% / cover;  
}

.header {
    text-align:center;
    font-size: 2em;
    color: #fff;
    text-shadow: 0 0.125em 0.125em #000;
}

#title {


background-image: url(../images/background1.jpg);
background-attachment: fixed;  
}

#slide1:before {

background-image: url(../images/background3.jpg);

transform: translateZ(-.0625em) scale(2);
  z-index:-1;
}
.clearfix:after {
   content: " "; /* Older browser do not support empty content */
   visibility: hidden;
   display: block;
   height: 0;
   clear: both;
}


#slide2 {


background-image: url(../images/background2.jpg);


background-attachment: fixed;
}


#slide4 {
  background: #000;
}

0 个答案:

没有答案