jQuery - localStorage

0 votes
178 views
added Mar 13, 2019 in jQuery by LC Marshal Captain (25,790 points)
function showSto () {
  $(stoBanner).show();
  // localStorage.setItem('panelHidden', 'false');
  $(stoBanner).addClass('in');
  $('.sto-ads .slide-close').on('click', function(){
    $(this).parent().parent().removeClass('in');
    localStorage.setItem('stoHidden', 'true');
  });
};

if ($('body').hasClass('front')) {

  if (localStorage.getItem('stoHidden') == 'true' ){
    $(stoBanner).hide();
  } else {
    showSto(); 
    localStorage.setItem('stoHidden', 'false');
    console.log('front')
  };

} else {
// do nothing
}

 

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