$( '.home-slider' ).on( 'init', function () { $( '.mob-img, .desk-img' ).remove(); $( '.home-slider-container' ).css( 'background', '#f8f8f8' ); } ); $( '.home-slider.slick' ).not('.slick-initialized').slick();