|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi, I want to make a navigation very similar to macromedia's with the sublinks appearing on mouseover. However I don't want them to dissapear on mouseout.
I have div tags with the same class but different ID's. How can i use links with mouseover events to acheive to switch which ones are visible? |
|
#2
|
|||
|
|||
|
I think I might have something for you.
The following function is used to show only one DIV at a time from a list of multiple DIVs. Code:
function ShowInfo(id)
{
i = 0;
while(1)
{
el = document.getElementById('info_'+i);
if(el)
{
if(id == i)
{
el.style.display = el.style.display == 'none' ? '' : 'none';
}
else
{
el.style.display = 'none';
}
}
else
{
break;
}
i++;
}
}
The DIVs (or TD or whatever) are sequentially named like: Code:
<div id="info_0" style="display: none">First DIV</div> <div id="info_1" style="display: none">Second DIV</div> <div id="info_2" style="display: none">you get the point</div> The call ShowInfo(1) will show the div with info_1. Then ShowInfo(0) will hide info_1 and show info_0. Then ShowInfo(0) will hide info_0 again. You can add DIVs as you like without changing the function! As long as you number them sequentially ![]() |
|
#3
|
|||
|
|||
|
Quote:
Nice touch! That works perfectly. Thanks a million! |
|
#4
|
|||
|
|||
|
Quote:
You're welcome. Can we see the result somewhere??? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Sublink style navigation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|