onSelector()
has been turned into the SelectorObserver
class to reduce the performance impact on larger sites:
The SelectorObserver.addListener()
method is backwards compatible with the old onSelector()
function, so you can just add the class instance in front (for full backwards compat use document.body
for the baseElement parameter), then change the old function's name and it should work as before.
For more info and examples, please view the SelectorObserver documentation