Banner image can be clicked once a day

Discussion in 'JavaScript' started by ThoRaK, Oct 25, 2010.

  1. #1
    I have this popunder javascript

    <script type="text/javascript" language="javascript">
    function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(6*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }
    
    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }
    
    
    
    
    function popMarket(url){
    
    
    
    var x = readCookie('popup-crk');
    
    if (!x) {
    createCookie('popup-crk','1',1);
    window.open("http://google.com", "_blank","toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, copyhistory=yes, width=336, height=297, left=300, top=1, resizable=yes");}
    window.blur();
    window.focus();
    }
    </script>
    <body onclick="popMarket('http://google.com')">
    Code (markup):


    What i am trying to do...

    I am trying to replace the popunder with a image banner. When somebody click that banner, i want to disappear, and appear for that person,the next day (like that popunder does).

    I have this script who make image to dissaper after u click-it, but if u refresh the page will reapper.

    View attachment img-disappear.html

    p.s. i'm trying to combine those two.
    ps.2. I desperately need this script

    Thanks.
     
    ThoRaK, Oct 25, 2010 IP