jquery - Show welcome div only once per user / browser session -


i want show welcome div once per user or session. know there jquery option. since newbie jquery, have not been able resolve myself. please help

$(document).ready(function() {    $("#close-welcome").click(function() {      $(".welcome").fadeout(1000);    });  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <div class="welcome">    <div>      <h1>hello..!<br> welcome abc      <br>      </h1>      <h2>we wish great day..!</h2>      <br>        <h2><a id="close-welcome" href="#">thank you.. , please take me     website</a> </h2>    </div>  </div>

i want show welcome page once, till user closes browser.. awaiting valuable help

set cookie.

$(document).ready(function() {     if ($.cookie('noshowwelcome')) $('.welcome').hide();     else {         $("#close-welcome").click(function() {             $(".welcome").fadeout(1000);             $.cookie('noshowwelcome', true);             });     } }); 

you need include jquery.cookie javascript file.

https://raw.githubusercontent.com/carhartl/jquery-cookie/master/src/jquery.cookie.js


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -