我正在努力完成上述工作。这就是我所拥有的:
功能切换可见性(除法){
if (divid="homepagecontent")
{
document.getElementById("homepagecontent").style.visibility = "visible";
document.getElementById("programmingcontent").style.visibility = "hidden";
document.getElementById("mediacontent").style.visibility = "hidden";
document.getElementById("contactcontent").style.visibility = "hidden";
document.getElementById("aboutcontent").style.visibility = "hidden";
document.getElementById("parentalcontent").style.visibility = "hidden";
document.getElementById("sitedesigncontent").style.visibility = "hidden";
}
else if (divid="programmingcontent")
{
document.getElementById("homepagecontent").style.visibility = "hidden";
document.getElementById("programmingcontent").style.visibility = "visible";
document.getElementById("mediacontent").style.visibility = "hidden";
document.getElementById("contactcontent").style.visibility = "hidden";
document.getElementById("aboutcontent").style.visibility = "hidden";
document.getElementById("parentalcontent").style.visibility = "hidden";
document.getElementById("sitedesigncontent").style.visibility = "hidden";
}
else if (divid="mediacontent")
{
document.getElementById("homepagecontent").style.visibility = "hidden";
document.getElementById("programmingcontent").style.visibility = "hidden";
document.getElementById("mediacontent").style.visibility = "visible";
document.getElementById("contactcontent").style.visibility = "hidden";
document.getElementById("aboutcontent").style.visibility = "hidden";
document.getElementById("parentalcontent").style.visibility = "hidden";
document.getElementById("sitedesigncontent").style.visibility = "hidden";
}
else if (divid="contactcontent")
{
document.getElementById("homepagecontent").style.visibility = "hidden";
document.getElementById("programmingcontent").style.visibility = "hidden";
document.getElementById("mediacontent").style.visibility = "hidden";
document.getElementById("contactcontent").style.visibility = "visible";
document.getElementById("aboutcontent").style.visibility = "hidden";
document.getElementById("parentalcontent").style.visibility = "hidden";
document.getElementById("sitedesigncontent").style.visibility = "hidden";
}
else if (divid="aboutcontent")
{
document.getElementById("homepagecontent").style.visibility = "hidden";
document.getElementById("programmingcontent").style.visibility = "hidden";
document.getElementById("mediacontent").style.visibility = "hidden";
document.getElementById("contactcontent").style.visibility = "hidden";
document.getElementById("aboutcontent").style.visibility = "visible";
document.getElementById("parentalcontent").style.visibility = "hidden";
document.getElementById("sitedesigncontent").style.visibility = "hidden";
}
else if (divid="parentalcontent")
{
document.getElementById("homepagecontent").style.visibility = "hidden";
document.getElementById("programmingcontent").style.visibility = "hidden";
document.getElementById("mediacontent").style.visibility = "hidden";
document.getElementById("contactcontent").style.visibility = "hidden";
document.getElementById("aboutcontent").style.visibility = "hidden";
document.getElementById("parentalcontent").style.visibility = "visible";
document.getElementById("sitedesigncontent").style.visibility = "hidden";
}
else if (divid="sitedesigncontent")
{
document.getElementById("homepagecontent").style.visibility = "hidden";
document.getElementById("programmingcontent").style.visibility = "hidden";
document.getElementById("mediacontent").style.visibility = "hidden";
document.getElementById("contactcontent").style.visibility = "hidden";
document.getElementById("aboutcontent").style.visibility = "hidden";
document.getElementById("parentalcontent").style.visibility = "hidden";
document.getElementById("sitedesigncontent").style.visibility = "visible";
}
}
</script>
i am calling the function with an onclick event:
(each of the seven buttons are different. this is just the first one)
a href="#" onclick="toggleVisibility('homepagecontent');" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('home','','../img/nav_img/images/highlight-ui-kit_03.png',1)"><img
src="../img/nav_img/images/ui-kit_03.png" name="home" width="149" height="63" id="home" /></a>
我不能让它工作。我在搞什么鬼???我已经在板上查看了几个这样的问题,但是对于我的一生,我可以弄清楚我做错了什么......任何帮助将不胜感激。