Visible.js
jQuery Visible/Unvisible Plug-in based on DOM listener and independent from way of visibility changing.
It generates becameVisible
and becameUnvisible
events that can be catched by jQuery:
... $('#my_tag').on('becameVisible', function() { alert('Visible'); }); $('#my_tag').on('becameUnvisible', function() { alert('Unvisible'); }); ...
Supported browsers
All browsers, that supported by jQuery AND Mutation Observer:
- Firefox 59+
- Chrome 49+
- Chrome for Android 66+
- IE 11+
- Edge 16+
- Safari 11.1+
- iOS Safari 10.3+
Requirements
- jQuery 1.7.0+
License
Distributed under MIT License.