如何在视差范围内嵌套materializecss滑块?

时间:2015-11-01 04:08:46

标签: html css slideshow parallax materialize

我想在materialcss视差中嵌入一个materializecss滑块。可以这样做吗?

我可以让每件作品都很好,但是当我把它们筑巢时,我只会得到带有字幕的灰色区域。

这是我的代码

<div class="parallax-container">
  
<div class="parallax">
      	
    <div class="slider">
        <ul class="slides">
      			<li>
        			<img src="images/new-york-city.jpg">
        			<div class="caption center-align brown-text text-darken-2">
         		 		<h3>This is our big Tagline!</h3>
          				<h5 class="light grey-text text-darken-2">Here's our small slogan.</h5>
        			</div>
      			</li>
      			
      			<li>
        			<img src="images/coffee.jpg">
        			<div class="caption center-align blue-grey-text text-darken-4">
          				<h3>This is our big Tagline!</h3>
          				<h5 class="light blue-grey-text text-darken-4">Here's our small slogan.</h5>
        			</div>
      			</li>    		
        </ul><!-- /slides -->
  	</div><!-- /slider -->
      
</div><!-- /parallax -->
</div><!-- /parallax-container -->

由于

1 个答案:

答案 0 :(得分:3)

你只能使用这样的滑块:

&#13;
&#13;
      	
    <div class="slider">
        <ul class="slides">
      	    <li>
        	    <img src="images/new-york-city.jpg">
        		<div class="caption center-align brown-text text-darken-2">
         		 	<h3>This is our big Tagline!</h3>
          			<h5 class="light grey-text text-darken-2">Here's our small slogan.</h5>
        		</div>
      		</li>
      			
      		<li>
        		<img src="images/coffee.jpg">
        		<div class="caption center-align blue-grey-text text-darken-4">
          			<h3>This is our big Tagline!</h3>
          			<h5 class="light blue-grey-text text-darken-4">Here's our small slogan.</h5>
        		</div>
      		</li>    		
        </ul><!-- /slides -->
  	</div><!-- /slider -->
      
&#13;
&#13;
&#13;

然后把它放在你的css文件中

.slides li img {
  background-attachment: fixed;
}

它会正常工作:)