jQuery.eye is a jQuery plugin for monitoring changes made to elements' DOM or CSS properties as well as monitoring changes of the returned results from jQuery methods ran on a given element. When a change is detected a callback function is fired. Additionally provided are methods for pausing a watch, starting a watch, and retrieving a watch status associated with an element.
Wil Neeley ( @wilneeley / puppetlabs.com / github.com )
jquery.eye.min.js after jQuery in your header or elsewhere in your page.
Initialize Watches w/ jQuery.eye
// Register element(s) to watch DOM and CSS properties;// Register the element to watch and the properties to watch;// Watch for the addition of the class 'some-class' to the DIV;// Run a callback immediately on registration;
Using Eye Methods
// Pause a watch;// Re-start a paused watch;// Return the status of a watched element;// Remove a watched property from a watch;
Tested with jQuery 1.4.x+.
Works in IE6+, Chrome 14+, Safari 4+, Firefox 3.0+, Opera 10+.
example.html in examples folder.
- initial version
- gave registered callbacks the ability to run once upon registration
- updated with build package via package.json