PDA

View Full Version : Change background of Tooltip when it is persons birthday



alongside2
09-21-2008, 07:07 PM
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.


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..

thetestingsite
09-21-2008, 07:11 PM
Add the optional bgColor attribute to the code like so:



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:



messages[0] = new Array('4mos.jpg','Me at 4 months old.<br>Birthday: 9/23', '#CC0000', '#EEEEEE');


Hope this helps.

alongside2
09-21-2008, 07:22 PM
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.

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:

var today=new Date();
var currMonth=today.getMonth()+1;


Add the optional bgColor attribute to the code like so:



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:



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
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.

alongside2
09-21-2008, 09:08 PM
Wonder should my post and question be placed in the Javascript section. It does concern Javascript but it also concerns one of DD scripts.