What keeps you from using CSS:

#calendar td.day {
background-color:#fff;
}

#calendar td.day:hover {
background-color:#ddd;
}

#calendar td.day > span {
visibility:hidden;
}

#calendar td.day:hover > span {
visiblity:visible;
}

?

If for some reason you cannot do that, you should be able to add

item.childNodes[indexOfYourSpanElement].setStyle({visibility:'hidden/visible'});

into your event handlers.

Alex

Am 09.05.2009 13:55, schrieb noddy:
> I have the following code changing the cell background on mouse over/
> out.
>
>     1. document.observe('dom:loaded', function() {
>     2.       $$('#calendar td.day').each(function(item) {
>     3.           item.observe('mouseover', function() {
>     4.               item.setStyle({ backgroundColor: '#ddd' });
>     5.           });
>     6.           item.observe('mouseout', function() {
>     7.               item.setStyle({backgroundColor: '#fff' });
>     8.           });
>     9.       });
>    10.
>    11. });
>
> I now need to display a link in a<span>  within the cell when the
> mouse is over the cell. How can this be done?
>
> Thanks.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to