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.7
npmnpm
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
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 26 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.