Results 1 to 4 of 4

Thread: balloon tip onload, once per session

  1. #1
    Join Date
    Jun 2009
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default balloon tip onload, once per session

    I am using script: http://www.dynamicdrive.com/dynamici...oontooltip.htm

    Have it working great... But there are 2 things I would like to resolve/achieve, if someone could help me.

    I am not really very advanced with scripting so if you can help, make it clear, thanks.

    1) Have the tooltip appear on page load rather than mouseover

    2) Have the tooltip only load the first time someone opens the page in a single session

    THANKS IN ADVANCE!
    Last edited by jscheuer1; 06-22-2009 at 03:17 PM. Reason: post moved, edited for sense

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,069
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    OK, on your page put this (highlighted) code after the balloon tip js external script tag (partially shown for reference, but not highlighted):

    Code:
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    </script>
    <script type="text/javascript">
    var cookie = {
    set:function(n, v, d){ //name value optional_persist_days
    if(d){var dt=new Date(); 
    dt.setDate(dt.getDate()+d);
    d='; expires='+dt.toGMTString();}
    document.cookie=n+'='+escape(v)+(d? d : '')+'; path=/';
    },
    get:function(n){ //name
    var c=document.cookie.match('(^|;)\x20*'+n+'=([^;]*)');
    return c? unescape(c[2]) : null;
    },
    kill:function(n){ //name
    cookie.set(n, '', -1);
    }
    };
    onload=function(){
    if(!cookie.get('tipShown')){
    setTimeout("displayballoontip(document.getElementById('tip1'), {type:'mouseover'})", 0);
    setTimeout(delayhidemenu, 1000);
    cookie.set('tipShown', 'true');
    }
    }
    </script>
    In it I've colored red the two items you may wish to take note of. The first is a unique id you should assign to the tip trigger that you want to give this treatment to, ex:

    Code:
    <a id="tip1" href="http://www.dynamicdrive.com/style/" rel="balloon1">Dynamic Drive CSS Library</a>
    It will now display onload, once per session. The other item is the delay before removing the tip. I've set it to 1 second (1000 milliseconds). You may want to increase it. The higher the number, the longer the tip will display onload. If the user mouses over and out of the tip's trigger it will disappear onmouseout.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    thomasbill (06-23-2009)

  4. #3
    Join Date
    Jun 2009
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks John... that really is magical!
    Last edited by thomasbill; 06-23-2009 at 08:39 AM.

  5. #4
    Join Date
    Jun 2009
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

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
  •