Advertisement
Guest User

Untitled

a guest
Sep 15th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2. $(function() {
  3.  
  4.     if (localStorage) { //if local storage
  5.         if (!localStorage.getItem('visited')) { // if not site is visited before
  6.             $('#slickbox').show(); //show element
  7.         }
  8.     } else { //if not local storage use cookies or just show element in old browsers
  9.         $('#slickbox').show();
  10.     }
  11.  
  12.     // shows the slickbox on clicking the noted link  
  13.     $('#slick-show').click(function() {
  14.         $('#slickbox').show('slow');
  15.         return false;
  16.     });
  17.     // hides the slickbox on clicking the noted link  
  18. $('#slick-hide').click(function() {
  19. $('#slickbox').slideUp('fast');
  20. localStorage.setItem('visited', true); //set flag, site now visited and element hidden
  21. $('a#logo').tipsy('show');
  22. return false; });
  23.  
  24.     // toggles the slickbox on clicking the noted link  
  25.     $('#slick-toggle').click(function() {
  26.         $('#slickbox').toggle(400);
  27.         return false;
  28.     });
  29. });
  30. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement