Skip to main content

hasClass() jquery works just once

this is my code:

$(document).ready(function () {
    if($('#first-item').hasClass('active'){
        $( ".go-prev" ).addClass( "hideMe" );
    } else {
        $( ".go-prev" ).removeClass( "hideMe" );
    }
})

this code works just once and when I scroll to next page (slide) it does not remove the active class whats the solution

Via Active questions tagged javascript - Stack Overflow https://ift.tt/ZCdu0LV

Comments