Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scroll-into-view

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scroll-into-view - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

2

package.json
{
"name": "scroll-into-view",
"version": "1.4.0",
"version": "1.5.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "scrollIntoView.js",

@@ -7,3 +7,2 @@ var raf = require('raf');

}else{
element.scrollLeft = x;

@@ -62,8 +61,9 @@ element.scrollTop = y;

time = Date.now() - scrollSettings.startTime,
timeValue = 1 / scrollSettings.time * time;
timeValue = Math.min(1 / scrollSettings.time * time, 1);
if(
time > scrollSettings.time ||
time > scrollSettings.time + 20 ||
(Math.abs(location.differenceY) <= 1 && Math.abs(location.differenceX) <= 1)
){
setElementScroll(parent, location.x, location.y);
parent._scrollSettings = null;

@@ -73,10 +73,8 @@ return scrollSettings.end();

// Attempt to flatten out the value a little..
// ToDo: Flatten properly.
var valueX = scrollSettings.ease(Math.abs(Math.pow(timeValue,2) - timeValue)),
valueY = scrollSettings.ease(Math.abs(Math.pow(timeValue,2) - timeValue));
var valueX = timeValue,
valueY = timeValue;
setElementScroll(parent,
location.x - (location.differenceX - location.differenceX * valueX),
location.y - (location.differenceY - location.differenceY * valueY)
location.x - location.differenceX * Math.pow(1 - valueX, valueX / 2),
location.y - location.differenceY * Math.pow(1 - valueY, valueY / 2)
);

@@ -83,0 +81,0 @@

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