You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

hero-parallax

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hero-parallax

A cross-browser pure Javascript parallax plugin

1.4.6
npmnpm
Version published
Maintainers
1
Created
Source

Hero Parallax

A cross-browser pure Javascript parallax plugin

Usage

  • Import it in
<body>
    <!-- Your content -->
    <script src="parallax.js"></script>
    <script>
        new Parallax();
    </script>
</body>
  • Tag sections where you want the parallax effect with the class .parallax
<div class="parallax" style="background: url(myBackgroundImage.png)></div>

Options

You can optionally pass in a configuration option

<body>
    <!-- Your content -->
    <script src="parallax.js"></script>
    <script>
        new Parallax({
            speedRatio: 0.5
        });
    </script>
</body>

Options

OptionTypeDescription
speedRationumberA speed modifier to control the speed of the parallax effect. [A number between 0.1 and 0.5]
pixelsOverflowingnumberThe amount of pixels each parallax element scrolls
selectorstringThe class selector to use to target parallax elements
debugModebooleanWhether to show debug statements in the log

Keywords

parallax

FAQs

Package last updated on 25 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts