Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function launchWindow(id) {
  2.    
  3.         var myCookie = readCookie('amedisin1');
  4.         if(myCookie != null) return;
  5.         {
  6.        
  7.         //Get the screen height and width
  8.         var maskHeight = $(document).height();
  9.         var maskWidth = $(window).width();
  10.    
  11.         //Set heigth and width to mask to fill up the whole screen
  12.         $('#mask').css({'width':maskWidth,'height':maskHeight});
  13.        
  14.         //transition effect    
  15.         $('#mask').fadeIn(1000);   
  16.         $('#mask').fadeTo("slow",0.8); 
  17.    
  18.         //Get the window height and width
  19.         var winH = $(window).height();
  20.         var winW = $(window).width();
  21.              
  22.         //Set the popup window to center
  23.         $(id).css('top',  winH/2-$(id).height());
  24.         $(id).css('left', winW/2-$(id).width()/2);
  25.    
  26.         //transition effect
  27.         $(id).fadeIn(2000);
  28.         }
  29.        
  30.         else {
  31.         createCookie('amedisin1',1,7); 
  32.            
  33.         }
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement