Skip to content

lifter035/bound-sensor

This branch is up to date with aminpaks/bound-sensor:master.

Repository files navigation

Bound Sensor Project

I started this project because I couldn't find any easy way to find out once an element size inside of DOM changes. This doesn't exist until this day that I write this package by native browser except onresize for window.
I wrote this lightweight library to receive an event once an element's boundary changes.

Bound Sensor

This is the base library that is written for JavaScript project, you can find the code here and a working example here.

Angular Bound Sensor

This is a very small @Directive based on bound-sensor that does the job for you in Angular world. You can find the source code here, a live demo here and also an example source code here or here with CLI.

Known issue

IE 11 doesn't support custom event which is necessary to take advantage of communicating between elements within DOM. If you would like to use BoundSensor (or AngularBoundSensor) on IE 11 you have to install a polyfill for CustomEvent. I personally use this package, just import it into your polyfills.

Credits

Thanks to @nasreddineskandrani

About

Get inform once an element boundary changes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.3%
  • JavaScript 1.7%