justParallax.js An easy to use parallax plugin.
Feature navigation
Introduction
Wide browser support
Easy set-up
Customizable parallax settings
No jQuery needed
Notes
Playground

Introduction

justParallax.js is a lightweight javascript plugin which allows users to make the background of their webpage have a subtle parallax effect with just 2 lines of code.

justParallax.js is also fully customizable and does not depend on any Javascript library to function.

点击背景改变它。


Wide browser support

justParallax.js supports all major browsers including IE7+, Google Chrome, Mozilla Firefox, Safari, Opera and many more.


Easy set-up

Get justParallax.js up and running in just 4 easy steps.

  1. Add a background to your <body> tag.
  2. Include justParallax.js to your html document.
  3. Customize your parallax settings. (optional)
  4. Call ¨initParallax(settings);¨ when your page is ready.


Customizable parallax settings

justParallax.js supports multiple customizations, here is a list of all options and it's default values.

  1. <script src='./js/justParallax.js' type='text/javascript'><script>
  2. <script>
  3. //Default settings
  4. speed: 8; //The speed of the scrolling background, 1 is faster than 10.
  5. vertical: true; //Set to true if the background should scroll vertically.
  6. vertical_inversed: false; //Set to true if the vertical direction should be inversed.
  7. horizontal: true; //Set to true if the background should scroll horizontally.
  8. horizontal_inversed: false; //Set to true if the horizontal direction should be inversed.
  9. //An example of the usage of justParallax.js
  10. var settings = {
  11. speed: 5,
  12. vertical: true,
  13. vertical_inversed: true,
  14. horizontal: true,
  15. horizontal_inversed: false
  16. };
  17. initParallax(settings);
  18. </script>
You only have to define the settings in the variable that you want to change. All undefined settings will fall back to their default setting.


No jQuery needed

justParallax.js works with plain Javascript which gives the best performance and doesn´t need jQuery or any other Javascript library to function.


Notes

justParallax.js is merely a tool to achieve a great website, here are some tips and tricks about how to use the tool.

  1. Watch the users screen size.
    When the user scrolls, the background image will move and it will repeat itself when it has reached it's max. A good solution for this is to use patterns, patterns will repeat themselves and no one will have this problem.

  2. Play around with the settings
    By playing with the settings you will create the most wonderfull effects. For example: when you combine the vertical and horizontal scroll, the background will scroll diagonal.

  3. Request new features
    When you have some new ideas for features to this tool you can report them to this e-mail address or you can add a comment on the Codecanyon page .


Playground

Click the background to change it.

Option Setting
Speed:
vertical:
vertical_inversed:
horizontal:
horizontal_inversed:

适用浏览器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗.

来源:站长素材