abc
01-30-2005, 10:39 AM
Hello,
I have 5 images, when I click each image it shows the content corresponds to the image and hides others. It works fine. Now at the same time I want to change the color of the images, highlight the clicked one, the rest is the same. How can I do that?
function toggleMenu(currMenu) {
for (i=1; i<6; i++) {
var theMenu = 'menu'+i
var thisStyle = (document.getElementById) ? document.getElementById(theMenu).style : eval("document." + theMenu)
if(theMenu == currMenu) {
thisStyle.display = "block"
thisStyle.visibility = "visible"
} else {
thisStyle.visibility = "hidden"
thisStyle.display = "none"
}
}
}
Thanks!
I have 5 images, when I click each image it shows the content corresponds to the image and hides others. It works fine. Now at the same time I want to change the color of the images, highlight the clicked one, the rest is the same. How can I do that?
function toggleMenu(currMenu) {
for (i=1; i<6; i++) {
var theMenu = 'menu'+i
var thisStyle = (document.getElementById) ? document.getElementById(theMenu).style : eval("document." + theMenu)
if(theMenu == currMenu) {
thisStyle.display = "block"
thisStyle.visibility = "visible"
} else {
thisStyle.visibility = "hidden"
thisStyle.display = "none"
}
}
}
Thanks!