New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

htmlautoscroll

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmlautoscroll - npm Package Compare versions

Comparing version 1.0.1 to 1.0.4

README.md

17

htmlautoscroll.js
var scrollDir = sessionStorage.getItem('direction') || 1
var scrollTimer;
function scrollMore(speed, extremityWait) {
function htmlautoscrollMore(speed, extremityWait, extremityCb) {
window.scrollBy(0, scrollDir * speed)

@@ -17,2 +17,5 @@ sessionStorage.setItem('scroll_position', window.pageYOffset)

if (reachedTop || reachedBottom) {
if (extremityCb) {
extremityCb(reachedBottom);
}
var nextDir = scrollDir * -1;

@@ -27,9 +30,13 @@ scrollDir = 0;

function startScroll(speed, extremityWaitMs = 2000) {
function htmlautoscrollStart(speed, extremityWaitMs = 2000, extremityCb) {
htmlautoscrollStop();
if (speed > 0) {
scrollTimer = setInterval(htmlautoscrollMore, speed > 1 ? 1 : 1 / speed, speed > 1 ? speed : 1, extremityWaitMs, extremityCb);
}
}
function htmlautoscrollStop() {
if (scrollTimer) {
clearInterval(scrollTimer);
}
if (speed > 0) {
scrollTimer = setInterval(scrollMore, speed > 1 ? 1 : 1 / speed, speed > 1 ? speed : 1, extremityWaitMs);
}
}
{
"name": "htmlautoscroll",
"version": "1.0.1",
"version": "1.0.4",
"description": "Automatically scroll HTML page indefinitely",

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

Sorry, the diff of this file is not supported yet

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