pixelcog / parallax.js

Simple parallax scrolling effect inspired by Spotify.com implemented as a jQuery plugin
MIT License
3.53k stars 838 forks source link

Should the example from the 2.0 alpha work? #243

Closed burzum closed 6 years ago

burzum commented 6 years ago

I've copy and pasted it and ran the JS in the console nothing happened. Tried to put it into a file just to be sure - didn't work either. The image simply disappears and the area is white. And the markup looks like that after the script was executed:

image

<div class="my-parallax-window">
  <div class="my-parallax-slider">
    <img src="img/parallax/werratalsee.jpg"/>
    <p>This content and the image will move when scrolling</p>
  </div>
  <div class="some-optional-fixed-content">
    <p>This content will stay in place</p>
  </div>
</div>
.my-parallax-window {
    min-height: 700px;
    background: transparent;
}
$('.my-parallax-window').parallax({
  speed: -.2,
  sliderSelector: '>.my-parallax-slider',
})
wstoettinger commented 6 years ago

Hey! sorry for my late response! Did you figure it out yet? please make sure that all elements in front of the body have a transparent background so nothing gets into the way of the parallax element.

best Wolfgang

burzum commented 6 years ago

Good morning Wolfgang, better late than never. ;)

I could not get it to work and found another solution that worked for me but I might drop the whole parallax thing because it has issues on mobile browser, no matter what solution I'm using. :(

wstoettinger commented 6 years ago

for mobile support check pull request #223 unfortunately i have not had time yet to look at it and merge it.

i will close this issue now since you are not pursuing it anymore. hope that's ok!