视差实现不初始化

时间:2017-10-08 05:14:26

标签: jquery html css materialize parallax

我认为我已经初始化了代码,但我仍然无法获得图像。我也只编写了两天,所以我不知道还有什么可能出错。到目前为止这是我的代码。谢谢!

    <!DOCTYPE html>
    <html>
    <head>
        <title>About Me</title>
        <meta charset="utf-8"/>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
       <link rel="stylesheet" type="text/css" href="bio.css"> 
       <link type="text/css" rel="stylesheet" href="css/materialize.min.css"  media="screen,projection"/>
       <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
       <script src="jquery-3.2.1.min.js"></script>         
   </head>
   <body>
       <div class="parallax-container">
           <div class="parallax"><img src="http://kids.nationalgeographic.com/content/dam/kids/photos/animals/Mammals/H-P/pig-young-closeup.ngsversion.1412640764383.adapt.945.1.jpg"></div>
       </div>   
       <div class="row container">
           <h2>About Me</h2>
           <p>words about me</p>
       </div>
       <div class="parallax-container">
           <div class="parallax"><img src="http://kids.nationalgeographic.com/content/dam/kids/photos/animals/Mammals/H-P/pig-young-closeup.ngsversion.1412640764383.adapt.945.1.jpg"></div>
       </div>
       <script>
       $(document).ready(function(){
        $('.parallax').parallax();
        });
       </script>
       <script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
       <script type="text/javascript" src="js/materialize.min.js"></script>
   </body>
   </html>

1 个答案:

答案 0 :(得分:0)

已编辑的代码

<!DOCTYPE html>
<html>
<head>
<title>About Me</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<link rel="stylesheet" type="text/css" href="bio.css">
<!--  commented Line     
<link type="text/css" rel="stylesheet" href="css/materialize.min.css"  media="screen,projection"/>
<script src="jquery-3.2.1.min.js"></script>
-->
</head>

<body>
<div class="parallax-container">
    <div class="parallax">
        <img src="https://www.petfinder.com/wp-content/uploads/2013/05/120251710-632x3531.jpg"></div>
</div>
<div class="row container">
    <h2>About Me</h2>
    <p>words about me</p>
</div>
<div class="parallax-container">
    <div class="parallax"><img src="https://www.petfinder.com/wp-content/uploads/2013/05/120251710-632x3531.jpg"></div>
</div>

<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<script>
//rearranged query - below the jquery and materialize library 
    $(document).ready(function() {
        $('.parallax').parallax();
    });
</script>
</body>

</html>