Results 1 to 2 of 2

Thread: Help with Popup Cookie Code here PLz...

  1. #1
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with Popup Cookie Code here PLz...

    Hello guys,

    I have this code for popup window, but there's no cookie here. I don't want to annoyvisitors each time they see my site... is it posible to put a cookie to show up once a month.. or once per session or once per visit and no more again?

    Code:
    <SCRIPT language=JavaScript type=text/javascript>
    <!--
    document.write("<table  width='460' height='400' border='0' cellpadding='0' cellspacing='0' style='display:none;position:absolute;top:10px;left:10px;empty-cells:hide' id='slidein'>");
    document.write("<tr><td colspan='3'><img src='img/dropin460top.gif' width='460' height='90'></td></tr>");
    document.write("<tr><td background='drop.gif' width='15' height='295'><img src='im.gif' width='15' height='1'></td>");
    document.write("<td bgcolor='white' width='430'>");
    document.write("<table width='430 height='100%' border='0' cellpadding='0' cellspacing='0'><tr>");
    document.write("<td height='12' valign='top' bgcolor='white' style='cursor:hand'> ");
    document.write("<div align='right' onclick='javascript:closewin();'><img src='close.gif'>&nbsp;</div></td></tr>");
    document.write("<tr><td width='100%' colspan='2' valign='top' bgcolor='white' id='dragtext' style='padding:4px' align=center>");
    document.write("<span class='class1'>Hello</span>");
    
    if ( document.getElementById ) newlayer = document.getElementById ( "slidein" ); 
    else newlayer = document.all ["slidein"]; 
    
    function placewin ( ) {   
    
    if ( document.getElementById )     content = document.getElementById ( "elemid" );   
    else     content = document.all ["elemid"];   
    if ( content.style.display == "none" )     {       content.style.display = "";       newlayer.style.height = "170px";     }   
    else     {       content.style.display = "none";       newlayer.style.height = "30px";     } } 
    
    function closewin ( ) {   newlayer.style.display = "none"; } 
    var wdt = 10, hgt = 20; 
    function xoff ( ) {   return ( ( window.pageXOffset ) ? window.pageXOffset : document.body.scrollLeft ) + wdt; } 
    function yoff ( ) {   return ( ( window.pageYOffset ) ? window.pageYOffset : document.body.scrollTop ) + hgt; } 
    function autoclose ( ) {   newlayer.style.top = yoff ( );   newlayer.style.left = xoff ( );   setTimeout ( "autoclose ( );", 1000 ); } 
    function pwID43568534v144 ( ) {   
      if ( wdt != 150 || hgt != 20 )     {       
       if ( wdt != 150 )         
        if ( Math.abs ( wdt - 150 ) <= 16.000000 )           wdt = 150;         
    	else           
    	 if ( wdt < 150 )             wdt += 16.000000;           
    	 else             wdt -= 16.000000;       
    	 if ( hgt != 20 )         
    	 if ( Math.abs ( hgt - 20 ) <= 16.000000 )           hgt = 20;         
    	 else           
    	 if ( hgt < 20 )             hgt += 16.000000;           
    	 else             hgt -= 16.000000;       newlayer.style.top  = yoff ( );       newlayer.style.left = xoff ( );       setTimeout ( "pwID43568534v144();", 20 );     }   
    	 else     autoclose ( ); } 
    function timedclose ( ) {   wdt = 150;   hgt = 20;   switch ( 1 )     {       case 3: wdt = -187;  break;       case 4: wdt = ( ( window.innerWidth ) ? window.innerWidth : document.body.clientWidth );  break;       case 1: hgt = -225;  break;       case 2: hgt = ( ( window.innerHeight ) ? window.innerHeight : document.body.clientHeight);  break;     }   newlayer.style.top  = yoff ( );   newlayer.style.left = xoff ( );   newlayer.style.display = "";   pwID43568534v144 ( ); } setTimeout ( "timedclose ( );", 7000 ); 
    var pwID43568534v157, pwID43568534v158; 
    function pwID43568534v159 ( e ) {   v160 = ( document.all ) ? event.clientX : e.clientX;   v161 = ( document.all ) ? event.clientY : e.clientY;   wdt += v160 - pwID43568534v157;   hgt += v161 - pwID43568534v158;   pwID43568534v157 = v160;   pwID43568534v158 = v161;   newlayer.style.top  = yoff ( );   newlayer.style.left = xoff ( ); } 
    function pwID43568534v162 ( ) { } 
    function pwID43568534v163 ( ) {   document.onmousemove = pwID43568534v162;   document.onmouseup   = pwID43568534v162; } 
    function pwID43568534v164 ( v165 ) {   pwID43568534v157 = ( document.all ) ? event.clientX : v165.clientX;   pwID43568534v158 = ( document.all ) ? event.clientY : v165.clientY;   document.onmousemove = pwID43568534v159;   document.onmouseup   = pwID43568534v163; } newlayer.onmousedown = pwID43568534v164;
    //-->
    </SCRIPT>
    Is it possible to put a cookie here? I don't know how.. could you point me to some resources? I'd appreciate that...

    Thanx...

  2. #2
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I know simple cookie script that goes smth, like this:

    HTML Code:
    if (getCookie ('visited') = "yes" )
    {
    something here....

    HTML Code:
    setCookie ('visited', 'yes');
    }
    But I'm not sure what to include between these two javascript lines...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •