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

vue-scroll-progress

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-scroll-progress - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "vue-scroll-progress",
"description": "Simple Vue.js plugin for page scroll progress bar",
"version": "1.0.2",
"version": "1.0.3",
"author": "spemer <ghsspower@naver.com>",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -7,8 +7,6 @@ var VueScrollProgress = {

progressEl,
height,
windowScrollPixels,
windowScrollPercents
windowScrollPercents,
height
// TODO: enable bottom scroll bar
progressContainerEl = document.createElement('div')

@@ -33,5 +31,31 @@ progressContainerEl.id = 'progress-container-el'

windowScrollPercents = 0
height = (document.documentElement.scrollHeight -
document.documentElement.clientHeight)
function getHeight() {
height = (document.documentElement.scrollHeight - document.documentElement.clientHeight)
}
const debounce = (func, wait, immediate) => {
var timeout
return () => {
const context = this,
args = arguments
const later = function () {
timeout = null
if (!immediate) func.apply(context, args)
}
const callNow = immediate && !timeout
clearTimeout(timeout)
timeout = setTimeout(later, wait)
if (callNow) func.apply(context, args)
}
}
var h = document.body
h.addEventListener('resize', debounce(() => {
getHeight()
console.log(height)
}, 200, false), false)
getHeight()
window.addEventListener('scroll', () => {

@@ -38,0 +62,0 @@ windowScrollPixels = (document.body.scrollTop ||

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