Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($) {
- $.fn.whenVisible = function(action) {
- $(this).each(function() {
- var el = this;
- var timer = setInterval(function(){
- if ($(el).height() == 0) {
- return;
- }
- action.call(el);
- $(el).trigger('visible');
- clearInterval(timer);
- }, 0.1);
- });
- return this;
- };
- })(jQuery);
Add Comment
Please, Sign In to add comment