I just created a rollover script but it does not work properly.
I don't see any problem but well... somone help me please.
Of course, there are many open sources for rollover images, but I want to know the "problem" with this scripts.
-------------------------------------
<script language="javascript">
var menuImgSvr = "image/";
var catMenu = [
[0, "n_menu_01_on.gif", "n_menu_01_off.gif"],
[1, "n_menu_02_on.gif", "n_menu_02_off.gif"],
[2, "n_menu_03_on.gif", "n_menu_03_off.gif"],
[3, "n_menu_04_on.gif", "n_menu_04_off.gif"],
[4, "n_menu_05_on.gif", "n_menu_05_off.gif"],
[5, "n_menu_13_on.gif", "n_menu_13_off.gif"],
[6, "n_menu_06_on.gif", "n_menu_06_off.gif"],
[7, "n_menu_07_on.gif", "n_menu_07_off.gif"],
[8, "n_menu_08_on.gif", "n_menu_08_off.gif"]
];
function cmChange(num)
{
topCat.img[num].src = menuImgSvr + catMenu[num][1];
if (typeof(subCat) == "object")
for (var i = 0; i < catMenu.length; i++)
{
if (catMenu[0] >= 0)
subCat[catMenu[0]].style.display = ((i == num) ? "" : "none");
}
}
function cmUnchange(num)
{
topCat.img[num].src = menuImgSvr + catMenu[num][2];
if (typeof(subCat) == "object")
for (var i = 0; i < catMenu.length; i++)
{
if (catMenu[0] >= 0)
subCat[catMenu[0]].style.display = "none";
}
}
</script>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"./menu.html" target=main>
<img name="img" id="img" src="image/n_menu_01_off.gif" border="0" onmouseover="cmChange(0)" onmouseout="cmUnchange(0)">
</a>
blah blah blah...
I don't see any problem but well... somone help me please.
Of course, there are many open sources for rollover images, but I want to know the "problem" with this scripts.
-------------------------------------
<script language="javascript">
var menuImgSvr = "image/";
var catMenu = [
[0, "n_menu_01_on.gif", "n_menu_01_off.gif"],
[1, "n_menu_02_on.gif", "n_menu_02_off.gif"],
[2, "n_menu_03_on.gif", "n_menu_03_off.gif"],
[3, "n_menu_04_on.gif", "n_menu_04_off.gif"],
[4, "n_menu_05_on.gif", "n_menu_05_off.gif"],
[5, "n_menu_13_on.gif", "n_menu_13_off.gif"],
[6, "n_menu_06_on.gif", "n_menu_06_off.gif"],
[7, "n_menu_07_on.gif", "n_menu_07_off.gif"],
[8, "n_menu_08_on.gif", "n_menu_08_off.gif"]
];
function cmChange(num)
{
topCat.img[num].src = menuImgSvr + catMenu[num][1];
if (typeof(subCat) == "object")
for (var i = 0; i < catMenu.length; i++)
{
if (catMenu[0] >= 0)
subCat[catMenu[0]].style.display = ((i == num) ? "" : "none");
}
}
function cmUnchange(num)
{
topCat.img[num].src = menuImgSvr + catMenu[num][2];
if (typeof(subCat) == "object")
for (var i = 0; i < catMenu.length; i++)
{
if (catMenu[0] >= 0)
subCat[catMenu[0]].style.display = "none";
}
}
</script>
<a href=http://www.webdeveloper.com/forum/archive/index.php/"./menu.html" target=main>
<img name="img" id="img" src="image/n_menu_01_off.gif" border="0" onmouseover="cmChange(0)" onmouseout="cmUnchange(0)">
</a>
blah blah blah...