1.0.7 • Published 6 years ago

vue-is-in-view v1.0.7

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

Vue Is In View

npm version npm downloads vue version

Vue.js plugin to detect when elements are and have been in the viewport For Vue 2.0.

Install

ES2015+

  • Available through npm as vue-is-in-view.
  import VueIsInView from 'vue-is-in-view';
  Vue.use(VueIsInView);

CommonJS

  • Available through npm as vue-is-in-view.
  const VueIsInView = require('vue-is-in-view');
  Vue.use(VueIsInView);

Direct include

  • You can also directly include it with a <script> tag when you have Vue included globally. It will add a global VueIsInView which can then be installed using
  Vue.use(VueIsInView);

Usage

Using the v-is-in-view directive

  <figure v-is-in-view></figure>
  <div v-is-in-view="{
    showIfPartial: true,
    callback: function(element) { console.log(element, 'in view!') }
  }"></div>

Class conditions

ClassCondition
is-in-viewApplied when all of the element is in the viewport
has-been-in-viewApplied after the whole of an element has been in the viewport once
is-partially-in-view*Applied when any part of an element is in the viewport
has-been-partially-in-view*Applied after any part of an element has been in the viewport

* Only available when the showIfPartial key is true in the configuration object, see above.

License

MIT

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago