Skip to content

Simple knockout binding to toggle a value when an element comes into or leaves the viewport.

License

Notifications You must be signed in to change notification settings

ronik-design/knockout-inview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

knockout-inview

Simple knockout binding to toggle a value when an element comes into or leaves the viewport.

Usage

<div data-bind="inview: foo"></div>
var foo = ko.observable(false);
foo.subscribe(function (val) {
  // will be triggered when inview update the val
});

Installation

This is how I use it with a Webpack bundled project. Your set-up may be different.

$ npm install knockout-inview --save-dev
import ko from "knockout";
import inview from "knockout-inview";

ko.bindingHandlers.inview = inview(ko);

About

Simple knockout binding to toggle a value when an element comes into or leaves the viewport.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published