Apply condition function on multiple element with same class name
1 2 3 4 5 6 7 |
jQuery('.section-container .img-logo').each(function() { if (jQuery(this).isOnScreen()) { jQuery(this).addClass('is-on-screen'); } else { jQuery(this).removeClass('is-on-screen'); } }); |
Leave a Comment