I would give each navigation element an ID, but that's just me.
Working with the HTML you have here, you could do this to hook into
TJ's elegant code.
$$('div. posnavtext1 a').each(function(element){
element.observe('mouseover',function(evt){
new Effect.Appear(element, {
queue: {
scope: element.identify(),
position: 'end'
}
});
});
element.observe('mouseout',function(evt){
new Effect.Fade(element, {
queue: {
scope: element.identify(),
position: 'end'
}
});
});
});
Get rid of all the onwhatever event handlers in your HTML. They aren't
needed any more.
Walter
On May 22, 2009, at 9:07 AM, BB Design wrote:
>
> For example, this is what I'm trying, but it isn't working:
>
> <script type="text/javascript" language="javascript">
> function navicon1on {
> effect.appear('navicon1', {duration: 0.3});
> }
> function navicon1off {
> effect.fade('navicon1', {duration: 0.3});
> }
> </script>
>
> <div class="posnavtext1"><a onmouseover="navicon1on();"
> onmouseout="navicon1off();" href="index.asp">HOME</a></div>
> <div id="navicon1" class="posnavicon1" style="display: none;"><img
> src="art/ic_homeHover.gif" alt="Home" width="71" height="55"
> border="0" /></div>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---