1- ![ simpleParallax logo] ( https://simpleparallax.b-cdn.net/images/logo.png?new=new )
2-
3- [ ![ GitHub version] ( https://badge.fury.io/gh/geosenna%2FsimpleParallax.svg )] ( https://badge.fury.io/gh/geosenna%2FsimpleParallax ) [ ![ ] ( https://img.shields.io/npm/dm/simple-parallax-js )] ( https://www.npmjs.com/package/simple-parallax-js ) [ ![ GitHub issues] ( https://img.shields.io/github/issues/geosigno/simpleParallax.js.svg )] ( https://GitHub.com/geosigno/simpleParallax.js/issues/ ) [ ![ ] ( https://data.jsdelivr.com/v1/package/npm/simple-parallax-js/badge?style=rounded )] ( https://www.jsdelivr.com/package/npm/simple-parallax-js )
1+ <div align =" center " >
2+ <picture >
3+ <source srcset =" https://simpleparallax.com/logo-vertical-dark.png " media =" (prefers-color-scheme: dark) " >
4+ <source srcset =" https://simpleparallax.com/logo-vertical-light.png " media =" (prefers-color-scheme: light) " >
5+ <img src =" https://simpleparallax.com/logo-vertical-dark.png " alt =" Logo " width =" 400 " height =" 180 " style =" display :block ;margin :0 auto ;" >
6+ </picture >
7+ </div >
48
59# simpleParallax.js
610
@@ -61,14 +65,14 @@ simply add the following JavaScript code :
6165
6266``` javascript
6367const image = document .getElementsByClassName (' thumbnail' );
64- new simpleParallax (image);
68+ new SimpleParallax (image);
6569```
6670
6771You can also choose to apply the parallax on multiple images :
6872
6973``` javascript
7074const images = document .querySelectorAll (' img' );
71- new simpleParallax (images);
75+ new SimpleParallax (images);
7276```
7377
7478Once simpleparallax has been correctly initialized, it adds the ``` simple-parallax-initialized ``` class on the container.
@@ -83,7 +87,7 @@ simpleParallax now works with video :
8387
8488``` javascript
8589var video = document .getElementsByTagName (' video' );
86- new simpleParallax (video);
90+ new SimpleParallax (video);
8791```
8892
8993## Settings
@@ -142,7 +146,7 @@ const Component = () => (
142146
143147``` javascript
144148var images = document .querySelectorAll (' .thumbnail' );
145- new simpleParallax (images, {
149+ new SimpleParallax (images, {
146150 delay: 0 ,
147151 orientation: ' down' ,
148152 scale: 1.3 ,
@@ -186,7 +190,7 @@ Refresh a simpleParallax instance (to recalculate all the positions) :
186190
187191``` javascript
188192var images = document .querySelectorAll (' img' );
189- var instance = new simpleParallax (images);
193+ var instance = new SimpleParallax (images);
190194instance .refresh ();
191195```
192196
@@ -197,7 +201,7 @@ Destroy a simpleParallax instance:
197201
198202``` javascript
199203var images = document .querySelectorAll (' img' );
200- var instance = new simpleParallax (images);
204+ var instance = new SimpleParallax (images);
201205instance .destroy ();
202206```
203207
0 commit comments