Results 1 to 4 of 4

Thread: Change background of Tooltip when it is persons birthday

  1. #1
    Join Date
    Sep 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Change background of Tooltip when it is persons birthday

    1) Script Title:Image w/ description tooltip

    2) Script URL (on DD): http://dynamicdrive.com/dynamicindex4/imagetooltip.htm

    3) Describe problem: I am using the script fine at the moment. I am attempting to tweak it so I can have the background of the persons Tooltip background when it is their birth month.

    Code:
    messages[0] = new Array('4mos.jpg','Me at 4 months old.<br>Birthday: 9/23');
    I have everyone that wished to make their birth day and date public for our companies internal intranet. Any help would be greatly appreciated..

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Add the optional bgColor attribute to the code like so:

    Code:
    messages[0] = new Array('4mos.jpg','Me at 4 months old.<br>Birthday: 9/23', '#CC0000');
    You could also add the optional textColor attribute as well like so:

    Code:
    messages[0] = new Array('4mos.jpg','Me at 4 months old.<br>Birthday: 9/23', '#CC0000', '#EEEEEE');
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Sep 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks...

    Sorry should be more clear in my writing... Not the best at javascript but have the following so far but not sure how to get it to work when someone moves their mouse over the link that brings up the tooltip.
    Code:
    var birthMonth = messages.substring(messages.lastIndexOf('/'),messages.lastIndexOf('/')-2);
    {
    if (birthMonth == currMonth)
    			{
    			style.tipBgColor = "#ff69b4";
    			}
    		else 	{
    			style.tipBgColor = '#eae3c6';
    			}
    }}
    And have the following load up for the month:
    Code:
    var today=new Date();
    var currMonth=today.getMonth()+1;
    Quote Originally Posted by thetestingsite View Post
    Add the optional bgColor attribute to the code like so:

    Code:
    messages[0] = new Array('4mos.jpg','Me at 4 months old.<br>Birthday: 9/23', '#CC0000');
    You could also add the optional textColor attribute as well like so:

    Code:
    messages[0] = new Array('4mos.jpg','Me at 4 months old.<br>Birthday: 9/23', '#CC0000', '#EEEEEE');
    Hope this helps.
    I have the code set up with
    Code:
    messages[0] = new Array('4mos.jpg','Me at 4 months old.<br>Birthday: 9/23',"#FFFFFF");
    I had taken out the FFFFF due to me experimenting.
    Last edited by alongside2; 09-21-2008 at 07:22 PM. Reason: Spelling error...

  4. #4
    Join Date
    Sep 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Just noticed and realized

    Wonder should my post and question be placed in the Javascript section. It does concern Javascript but it also concerns one of DD scripts.

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
  •