universal-parallax
Advanced tools
Comparing version 1.2.1 to 1.2.2
{ | ||
"name": "universal-parallax", | ||
"version": "1.2.1", | ||
"description": "Easy parallax plugin using pure javascript. Cross browser compatibility, including mobile platforms (iOS, Android). Support for opaque backgrounds.", | ||
"version": "1.2.2", | ||
"description": "Easy parallax plugin using pure javascript. Lightweight (2kb) and cross browser compatibility - including mobile platforms (iOS, Android).", | ||
"main": "dist/universal-parallax.js", | ||
@@ -24,5 +24,3 @@ "repository": { | ||
"mobile", | ||
"phone", | ||
"mobile parallax support", | ||
"phone parallax support" | ||
"phone" | ||
], | ||
@@ -29,0 +27,0 @@ "author": "Marius Hansen <marius.o.hansen@gmail.com>", |
@@ -0,3 +1,5 @@ | ||
[](https://badge.fury.io/js/universal-parallax) [](https://www.jsdelivr.com/package/npm/universal-parallax) | ||
# Universal Parallax | ||
Easy parallax plugin using pure javascript. Cross browser compatibility, including mobile platforms (iOS, Android). Support for opaque backgrounds. | ||
Easy parallax plugin using pure javascript. Lightweight (2kb) and cross browser compatibility - including mobile platforms (iOS, Android). | ||
@@ -12,3 +14,3 @@ #### [See demo](https://marrio-h.github.io/universal-parallax/demo/) | ||
- Works on mobile devices | ||
- Can have opacity without affecting content | ||
- Lightweight (2kb minified) | ||
@@ -19,10 +21,4 @@ ## :floppy_disk: Install | ||
## :rocket: Setup | ||
#### #1 | ||
Include the script at the bottom of your project | ||
```html | ||
<script src="node_modules/universal-parallax/dist/universal-parallax.min.js"></script> | ||
``` | ||
#### #2 | ||
_Choose between:_ | ||
@@ -55,2 +51,4 @@ | ||
transform: translate3d(0, 0, 0); | ||
-webkit-transform-style: preserve-3d; | ||
transform-style: preserve-3d; | ||
width: 100%; | ||
@@ -66,3 +64,3 @@ | ||
#### #3 | ||
#### #2 | ||
If `<section>` is your container, make the parallax element inside it | ||
@@ -78,7 +76,16 @@ | ||
#### #3 | ||
Include the script to your project | ||
```html | ||
<script src="node_modules/universal-parallax/dist/universal-parallax.min.js"></script> | ||
``` | ||
#### #4 | ||
Initialize the JS function | ||
```js | ||
new universalParallax().init(); | ||
```html | ||
<script> | ||
new universalParallax().init(); | ||
</script> | ||
``` | ||
@@ -105,5 +112,7 @@ | ||
## Opacity | ||
Transparency can be added and it won't affect the opacity of your content. | ||
## Tips | ||
#### Opacity | ||
If you want your backround color to shine through or dampen the image without making it a .png - just add transparency to it | ||
```css | ||
@@ -110,0 +119,0 @@ .parallax { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1809938
239
117
16