Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - localStorage

0 votes
8 views
added Mar 13 in jQuery by LC Marshal Captain (23,940 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
}

 

Please log in or register to response this reference.

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