• Moderatore

    Diversi pup-up

    Ho cercato come un matto un pop-up che mi si aprisse una volta al giorno per non infastidire i navigatori e ho trovato questi, magari a qualcuno serve:

    Pop-up in entrata:

    <SCRIPT language="JavaScript">window.open&#40;'http://www.internet-marketing.it','','toolbar=no,resizable=no,scrollbars=yes,menubar=no,location=no,width=400,height=300,left=100,top=100'&#41;;</SCRIPT>
    

    Pop-up Under:

    
    <SCRIPT language="JavaScript">window.open&#40;'http&#58;//www.internet-marketing.it','','toolbar=no,resizable=no,scrollbars=yes,menubar=no,location=no,width=400,height=300,left=100,top=100'&#41;.blur&#40;&#41;; window.focus&#40;&#41;;</SCRIPT>
    
    

    Pop-up in Uscita:

    
    <SCRIPT language="JavaScript">
    function popwin&#40;&#41; &#123;
    window.open&#40;'http&#58;//www.internet-marketing.it','','toolbar=no,resizable=no,scrollbars=yes,menubar=no,location=no,width=400,height=300,left=100,top=100'&#41;;
    &#125;
    </SCRIPT>
    
    <body onUnload="popwin&#40;&#41;">
    
    

    Pop-up tramite Click:

    
    <SCRIPT language="JavaScript">
    function popwin&#40;&#41; &#123;
    window.open&#40;'http&#58;//www.internet-marketing.it','','toolbar=no,resizable=no,scrollbars=yes,menubar=no,location=no,width=400,height=300,left=100,top=100'&#41;;
    &#125;
    </SCRIPT>
    
    [url="javascript&#58;popwin&#40;&#41;"]clicca qui
    
    

    Pop-up tramite cookies:

    
    <SCRIPT language="JavaScript">
    
    <!-- Begin
    var expDays = 60; // numero di giorni da aspettare prima che lo stesso navigatore riveda il popup
    
    function GetCookie &#40;name&#41; &#123;  
    var arg = name + "=";  
    var alen = arg.length;  
    var clen = document.cookie.length;  
    var i = 0;  
    while &#40;i < clen&#41; &#123;    
    var j = i + alen;    
    if &#40;document.cookie.substring&#40;i, j&#41; == arg&#41;      
    return getCookieVal &#40;j&#41;;    
    i = document.cookie.indexOf&#40;" ", i&#41; + 1;    
    if &#40;i == 0&#41; break;   
    &#125;  
    return null;
    &#125;
    function SetCookie &#40;name, value&#41; &#123;  
    var argv = SetCookie.arguments;  
    var argc = SetCookie.arguments.length;  
    var expires = &#40;argc > 2&#41; ? argv&#91;2&#93; &#58; null;  
    var path = &#40;argc > 3&#41; ? argv&#91;3&#93; &#58; null;  
    var domain = &#40;argc > 4&#41; ? argv&#91;4&#93; &#58; null;  
    var secure = &#40;argc > 5&#41; ? argv&#91;5&#93; &#58; false;  
    document.cookie = name + "=" + escape &#40;value&#41; + 
    &#40;&#40;expires == null&#41; ? "" &#58; &#40;"; expires=" + expires.toGMTString&#40;&#41;&#41;&#41; + 
    &#40;&#40;path == null&#41; ? "" &#58; &#40;"; path=" + path&#41;&#41; +  
    &#40;&#40;domain == null&#41; ? "" &#58; &#40;"; domain=" + domain&#41;&#41; +    
    &#40;&#40;secure == true&#41; ? "; secure" &#58; ""&#41;;
    &#125;
    function DeleteCookie &#40;name&#41; &#123;  
    var exp = new Date&#40;&#41;;  
    exp.setTime &#40;exp.getTime&#40;&#41; - 1&#41;;  
    var cval = GetCookie &#40;name&#41;;  
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString&#40;&#41;;
    &#125;
    var exp = new Date&#40;&#41;; 
    exp.setTime&#40;exp.getTime&#40;&#41; + &#40;expDays*24*60*60*1000&#41;&#41;;
    function amt&#40;&#41;&#123;
    var count = GetCookie&#40;'count'&#41;
    if&#40;count == null&#41; &#123;
    SetCookie&#40;'count','1'&#41;
    return 1
    &#125;
    else &#123;
    var newcount = parseInt&#40;count&#41; + 1;
    DeleteCookie&#40;'count'&#41;
    SetCookie&#40;'count',newcount,exp&#41;
    return count
       &#125;
    &#125;
    function getCookieVal&#40;offset&#41; &#123;
    var endstr = document.cookie.indexOf &#40;";", offset&#41;;
    if &#40;endstr == -1&#41;
    endstr = document.cookie.length;
    return unescape&#40;document.cookie.substring&#40;offset, endstr&#41;&#41;;
    &#125;
    
    function checkCount&#40;&#41; &#123;
    var count = GetCookie&#40;'count'&#41;;
    if &#40;count == null&#41; &#123;
    count=1;
    SetCookie&#40;'count', count, exp&#41;;
    
    window.open&#40;'http&#58;//www.internet-marketing.it','','toolbar=no,resizable=no,scrollbars=yes,menubar=no,location=no,width=400,height=300,left=100,top=100'&#41;;
    
    &#125;
    else &#123;
    count++;
    SetCookie&#40;'count', count, exp&#41;;
       &#125;
    &#125;
    //  End -->
    </SCRIPT>
    
    
    

    P.S: ricordarsi di aggiungere questo codice "<body OnLoad="checkCount()">" nel tag BODY

    Pop-up a tempo:

    <SCRIPT language="JavaScript">
    function popwin&#40;&#41; &#123;
    window.open&#40;'http&#58;//www.internet-marketing.it','','toolbar=no,resizable=no,scrollbars=yes,menubar=no,location=no,width=400,height=300,left=100,top=100'&#41;;
    &#125;
    </SCRIPT>
    
    <body onLoad="setTimeout&#40;'popwin&#40;&#41;',5000&#41;">
    
    
    

    Pop-up tempo:

      <SCRIPT>
       var ex="true";
         function PopUp&#40;x,y&#41;&#123;
        if&#40;x==2&#41;&#123;
         ex="false";
         document.location.href=y;
        &#125;
        else if &#40;x==3 && ex=="true"&#41;&#123;
    window.open&#40;'http&#58;//www.internet-marketing.it','','toolbar=no,resizable=no,scrollbars=yes,menubar=no,location=no,width=400,height=300,left=100,top=100'&#41;;
        &#125;
        else&#123;ex="true";&#125;
       &#125;
      </SCRIPT>
    
      [url="#"]Clicca qui
    
    

    Un gentile ringraziamento a madri.com, l'ho trovato se non ricordo male nel materiale che mi avevano dato quando ho preso un corso.


  • User Attivo

    Ciao,
    visto che qui è destinato a perdersi nei meandri del forum, stavo pensando che potresti fare un bell'articolo su [url=http://www.giorgiotave.it/wikigt/os/Pagina_principale]WikiGT

    😉