# Parallax isn't working for me

**URL:** <https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796>\
**Category:** Beginners\
**Tags:** bug\
**Created:** [April 14, 2018, 2:48pm UTC](https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796 "2018-04-14T14:48:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aymen](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@aymen](https://forum.pinegrow.com/u/aymen)\
**Post date:** [April 14, 2018, 2:48pm UTC](https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796/1 "2018-04-14T14:48:59Z")

</div>

I added a paralla code to my page, but the images don’t appear, when I remove the class “parallax” from container of the image, images appear but without the parallax effect,

```
  <div class="parallax-container">
    <div class="parallax"><img src="content/img/wood.jpg"></div>
  </div>
  <div class="section white">
    <div class="row container">
      <h2 class="header">Parallax</h2>
      <p class="grey-text text-darken-3 lighten-3">Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling.</p>
    </div>
  </div>
  <div class="parallax-container">
    <div class="parallax"><img src="content/img/wood.jpg"></div>
  </div>

<script type="text/javascript">
var elem = document.querySelector('.parallax');
var instance = M.Parallax.init(elem, options);

// Or with jQuery

$(document).ready(function(){
$('.parallax').parallax();
});

</script>

```

and these are the libraries I added

```
  <script src="app\lib\angular.min.js"></script>
  <script src="app\lib\angular-route.min.js"></script>
  <script src="app\lib\angular-aria.min.js"></script>
  <script src="app\lib\angular-messages.min.js"></script>
  <script src="app\lib\angular-animate.min.js"></script>
  <link rel="stylesheet" href="app\lib\angular-material.min.css">
  <script src="app\lib\angular-material.min.js"></script>
  <link rel="stylesheet" href="content/css/styles.css">
  <!--Materialize-->
  <link href="materialize\css\icon.css" rel="stylesheet">
  <link rel="stylesheet" href="materialize/css/materialize.min.css">
  <link rel="stylesheet" href="app\lib\Roboto.css">
  <script src="app\app.js"></script>
<script type="text/javascript" src="materialize\js\jquery.3.2.1.min.js"></script>
   <script src="materialize\js\materialize.min.js"></script>
```

---

<div class="post-metadata">

**Author:** ![Pinegrow\_User](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/pinegrow_user/32/4919_2.png) [@Pinegrow\_User](https://forum.pinegrow.com/u/Pinegrow_User)\
**Post date:** [April 14, 2018, 4:09pm UTC](https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796/2 "2018-04-14T16:09:19Z")

</div>

Welcome to the Pinegrow forums @aymen

Your setup looks to be ok, but are you calling your initialization after you reference the scripts? Without seeing the page itself that is my first guess.

---

<div class="post-metadata">

**Author:** ![SureWeb](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@SureWeb](https://forum.pinegrow.com/u/SureWeb)\
**Post date:** [April 14, 2018, 8:26pm UTC](https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796/3 "2018-04-14T20:26:16Z")

</div>

Just to add… as you are using multiple instances of the class parallax, you would need to use `document.querySelectorAll('.parallax')`

---

<div class="post-metadata">

**Author:** ![benhanna](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/benhanna/32/766_2.png) [@benhanna](https://forum.pinegrow.com/u/benhanna)\
**Post date:** [April 16, 2018, 12:01pm UTC](https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796/4 "2018-04-16T12:01:23Z")

</div>

You might just need to refresh the page in Pinegrow if you added all the above already

---

<div class="post-metadata">

**Author:** ![Pinegrow\_User](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/pinegrow_user/32/4919_2.png) [@Pinegrow\_User](https://forum.pinegrow.com/u/Pinegrow_User)\
**Post date:** [April 16, 2018, 3:19pm UTC](https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796/5 "2018-04-16T15:19:12Z")

</div>

I think the library itself handles that once you pass in your reference, but I could be mistaken.

---

<div class="post-metadata">

**Author:** ![Pinegrow\_User](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/pinegrow_user/32/4919_2.png) [@Pinegrow\_User](https://forum.pinegrow.com/u/Pinegrow_User)\
**Post date:** [April 16, 2018, 3:20pm UTC](https://forum.pinegrow.com/t/parallax-isnt-working-for-me/1796/6 "2018-04-16T15:20:30Z")

</div>

I had a minute so …

On the most basic level it does work with all the base libraries you showed you have loaded. There appears to be no conflicts and it is working.

In re-looking at your original post you have two initialization setups listed with an “or” between them. I am assuming you were showing things you tried and were not in fact actually using both together. The first being plain JS and the other using JQuery. If you are loading JQuery then you can just use that to initialize things.

Here is a basic working example with the libraries you listed:

```
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.8/angular-material.min.css" />
<style type="text/css">
.parallax-container {
    height: 800px;
}
.blank-container {
	background-color: lightgrey;
    height: 800px;
}
#loading {
 	top:0px
 	left:0px;
 	padding:0;
 	margin:0;
 	width:100%;
 	height:100%;
 	position:fixed;
 	background-color: white;
}
</style>
</head>
<body>
<div id="loading"></div>
<div class="parallax-container">
      <div class="parallax"><img src="https://source.unsplash.com/random/1920x1080?sig=1"></div>
</div>
<div class="blank-container"></div>
<div class="parallax-container">
     <div class="parallax"><img src="https://source.unsplash.com/random/1920x1080?sig=2"></div>
</div>
<div class="blank-container"></div>
<div class="parallax-container">
      <div class="parallax"><img src="https://source.unsplash.com/random/1920x1080?sig=3"></div>
</div>
<div class="blank-container"></div>
<div class="parallax-container">
      <div class="parallax"><img src="https://source.unsplash.com/random/1920x1080?sig=4"></div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular-route.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular-aria.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular-messages.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.5/angular-animate.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-material/1.1.8/angular-material.min.js"></script>
<script type="text/javascript">
$(window).on("load", function(){
   $.ready.then(function(){
		$('.parallax').parallax();
    	$('#loading').fadeOut(800);
   });
})
</script>
</body>
</html>

```

So your problem perhaps is somewhere else in your: **app.js** , **style.css** , etc., its nothing specific with Pinegrow and will be difficult for anyone to diagnose here.
