jQuery Navigation/ Promotional Banner- Cookie

Following is the code for a  Promotional banner which is supposed to be seen on all the pages of the website.

The banner would have the following functionalities:

  1. It should be displayed above the header.
  2. It has a close button.
  3. If anyone closes the banner it should not be displayed again on any page for that user for next 12 hours

Following is the fiddle of the code with output:

https://jsfiddle.net/krina1810/3gtdunet/10/

 

$(window).load(function () {
  // if no cookie
  if (Cookies.get('nav') != "true") {
    $("#pop-up").show();
    $("#hide").click(function () {
      $("#pop-up").slideUp("slow");
      // set the cookie for 24 hours
      var date = new Date();
		
       date.setTime(date.getTime() + 12 * 60 * 60 * 1000);
      Cookies.set('nav', "true", {
       expires: date,
		  path: '/'
      });
				
    });
  }
	else {
		console.log("No Navigation Banner");
	}
});
	
	$(window).on('beforeunload', function(){
		console.log("Unloading");
	});

84 thoughts on “jQuery Navigation/ Promotional Banner- Cookie

  1. Pingback: Google
  2. Pingback: 토토사이트
  3. Pingback: 먹튀검증
  4. Pingback: 안전놀이터
  5. Pingback: female sex toys
  6. Pingback: Ulisse e Polifemo
  7. Pingback: anal dildo
  8. Pingback: ссылка
  9. Pingback: beast tv apk
  10. Pingback: long dildo
  11. Pingback: سکس چت
  12. Pingback: 메이저공원
  13. Pingback: 사다리사이트
  14. Pingback: 먹튀그램
  15. Pingback: cursos online
  16. Pingback: Google
  17. Pingback: teen porn
  18. Pingback: fbvcursos
  19. Pingback: Food coupons
  20. Pingback: kegel massager
  21. Pingback: Intervew
  22. Pingback: curved vibrator
  23. Pingback: FIFA 19 Coins
  24. Pingback: Chicago SEO
  25. Pingback: online earn money
  26. Pingback: detox tea
  27. Pingback: shmmovers.com
  28. Pingback: cursos gratuitos
  29. Pingback: wand massager
  30. Pingback: music theory
  31. Pingback: Pornhub
  32. Pingback: VIP Desert Safari
  33. Pingback: chwilówki
  34. Pingback: silver bullet egg
  35. Pingback: suction cup dildo
  36. Pingback: anal vibrator
  37. Pingback: Porn City XXX
  38. Pingback: milking toy
  39. Pingback: Nerf Gun
  40. Pingback: montagu terroir
  41. Pingback: findabride login
  42. Pingback: los angeles seo
  43. Pingback: xxnx
  44. Pingback: Free
  45. Pingback: anal butt plugs

Leave a Reply