Remember to add a source of the image file in your HTML file. Parallax Engine that reacts to the orientation of a smart device. JAronomy gial and each Pole of the World. In the CSS file, customize the class “ parallax-init” as below. apatvetixos, Gri apt to persuade or admo- Horizontal PARALLAX ( in. There are 32 other projects in the npm registry using parallax-js. Start using parallax-js in your project by running npm i parallax-js. Latest version: 3.1.0, last published: 5 years ago. Add these classes in your HTML file like this: Parallax Engine that reacts to the orientation of a smart device. parallax.js reacts to the orientation of your smart device, offsetting layers depending on their depth within a scene. Where no gyroscope or motion detection hardware is available, the position of the cursor is used instead. Remember you can add more than one class in an HTML element. Parallax Engine that reacts to the orientation of a smart device. I made it separated classes in case you need to add more than one image source to your site. The important part for this to work is the div element in my HTML file with a class named “ parallax-init” (you can make your class name differently if you like), then I also added one more class “ parallax-bg1” as an example for image sources. #Parallax js how to#How to Make Parallax Effect with Image Background Using Pure CSSįirst, we will see the parallax effect for image backgrounds, it also works well with SVG files as you can see in my first demo.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |