Socket
Socket
Sign inDemoInstall

react-scroll-parallax

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-scroll-parallax - npm Package Compare versions

Comparing version 2.0.6 to 2.1.0

33

cjs/classes/ParallaxController.js

@@ -66,4 +66,4 @@ "use strict";

function _addListeners() {
viewEl.addEventListener('scroll', _handleScroll, supportsPassive ? {
function _addListeners(el) {
el.addEventListener('scroll', _handleScroll, supportsPassive ? {
passive: true

@@ -74,4 +74,4 @@ } : false);

function _removeListeners() {
viewEl.removeEventListener('scroll', _handleScroll, supportsPassive ? {
function _removeListeners(el) {
el.removeEventListener('scroll', _handleScroll, supportsPassive ? {
passive: true

@@ -82,3 +82,3 @@ } : false);

_addListeners();
_addListeners(viewEl);

@@ -249,2 +249,23 @@ _setViewSize();

};
this.updateScrollContainer = function (el) {
// remove existing listeners with current el first
_removeListeners(viewEl);
viewEl = el;
hasScrollContainer = !!el;
view = new _View.View({
width: 0,
height: 0,
scrollContainer: el
});
_setViewSize();
_addListeners(viewEl);
_updateAllElements({
updateCache: true
});
};
/**

@@ -256,3 +277,3 @@ * Removes listeners, reset all styles then nullifies the global ParallaxController.

this.destroy = function () {
_removeListeners();
_removeListeners(viewEl);

@@ -259,0 +280,0 @@ elements.forEach(function (element) {

@@ -75,2 +75,9 @@ "use strict";

_createClass(ParallaxProvider, [{
key: "componentDidUpdate",
value: function componentDidUpdate(prevProps) {
if (prevProps.scrollContainer !== this.props.scrollContainer) {
this.controller.updateScrollContainer(this.props.scrollContainer);
}
}
}, {
key: "componentWillUnmount",

@@ -77,0 +84,0 @@ value: function componentWillUnmount() {

2

package.json
{
"name": "react-scroll-parallax",
"version": "2.0.6",
"version": "2.1.0",
"description": "React components to create parallax scroll effects for banners, images or any other DOM elements.",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc