Home

Awesome

vue-scrollfire

Fires an event on a specific scroll position

Demo

Install

npm install --save-dev vue-scrollfire
// vue@1.0
npm install --save-dev vue-scrollfire@1

or include build/bundle.js.

Usage

# in your component
components:
  "scrollfire": require("vue-scrollfire")
# or, when using bundle.js
components:
  "scrollfire": window.vueComps.scrollfire
<scrollfire></scrollfire>

For examples see dev/.

Props

Nametypedefaultdescription
multipleBooleanfalseset to fire on every time the element enters, leaves or moves within the viewport
offsetNumber0lateral offset when to fire
afterNumber0milliseconds to wait until fire
ignoreParentBooleanfalsedon't use the bounding box of parent but of scrollfire span
initialBooleanfalsefires entered and left on initial page load when element top or bottom is in or above viewport

Events

Namedescription
enteredwill be fired on entering of viewport
progresswill be fired on scrolling of viewport. Argument: {top,bottom}
leftwill be fired on leaving of viewport

Changelog

Development

Clone repository.

npm install
npm run dev

Browse to http://localhost:8080/.

License

Copyright (c) 2016 Paul Pflugradt Licensed under the MIT license.