- This is a jquery plugin that watch change of css property.
- What makes it outstanding is that
- It can monitor some jquery complex property like
offset
,outerWidth
; - It uses polling, which means that every change can be dectected;
- There is
runs
,stop
andreset
apis, which can help you comfortablly control it.
- It can monitor some jquery complex property like
-
init:
$.watcher.runs(100);
-
add watching
$('div').watch(['offset', 'width'], function whenChange(){ console.log('some properties changed') })
-
unwatch
$('div').unwatch()
-
stop
$.watcher.stop()
-
reset => clear all watching
$.watcher.reset()