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

How to use this plugin with background-image #205

Closed D-Marc1 closed 7 years ago

D-Marc1 commented 7 years ago

Maybe I'm missing something here, but it seems like there is no way to use this plugin with the CSS background-image property. This would be great for using with background-size: cover.

wstoettinger commented 7 years ago

should be working when using the html version. make sure to set a minimum height for the parallax-window and the element with the background.

<div class="parallax-window">
  <div class="parallax-slider">
    <div class="with-background-image">Div with background image and minimum height</div>
  </div>
</div>
$('.parallax-window').parallax();
demeralde commented 6 years ago

@wstoettinger where can I find the styles for those classes in the mark-up?

wstoettinger commented 6 years ago

@dspacejs natively this library doesn't use styles. It just uses the class names to identify the elements.