jQuery - check whether button is clicked or not with .data

0 votes
194 views
added Feb 13, 2020 in jQuery by lcjr First Warrant Officer (11,530 points)
if (window.scrollY > 1) {
    HideAppBanner();
} else {
    $(AppClose).click(function() {
        $(this).data('clicked', true);
    });

    if($(AppClose).data('clicked')) {
        HideAppBanner();
    }
    else {
        ShowAppBanner();
    }
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...