Onbekend |
|
Je kan toch ook een kant en klaar script nemen:
<style>
a.nav:link { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none }
a.nav:visited { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none }
a.nav:active { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none }
a.nav:hover { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none; color: #33CCFF }
.HEADING { cursor: hand; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #FFFFFF;
background-color: #66CCFF; font-weight: none;
border: 2 solid #66CCFF }
.LINKSOFF { display: none; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #FFFFCC }
.LINKSON { display: inline; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #000080 }
</style>
<Script Language="VBscript">
Option Explicit
DIM menuID,menuObj,cellBk
SUB ShowHide(menuID)
menuObj = "Link" & menuID
cellbk = "Head" & menuID
if document.all.item(menuObj).className = "LINKSON" then 'IF MENU OPEN THEN CLOSE
document.all.item(menuObj).className = "LINKSOFF"
document.all.item(cellBk).style.backgroundColor = "#0000FF" ' SET CELL BACKGROUND COLOUR BLUE
ELSE
document.all.item(menuObj).className = "LINKSON" ' OPEN MENU
document.all.item(cellBk).style.backgroundColor = "#3366FF" ' SET CELL BACKGROUND COLOUR RED
END IF
END SUB
</Script>
<style> a .nav :link { font -family : Verdana ,Arial ,San Serif ; font -size : 10px ; text -decoration : none } a.nav:visited { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none } a.nav:active { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none } a.nav:hover { font-family: Verdana,Arial,San Serif; font-size: 10px; text-decoration: none; color: #33CCFF } .HEADING { cursor: hand; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #FFFFFF; background-color: #66CCFF; font-weight: none; border: 2 solid #66CCFF } .LINKSOFF { display: none; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #FFFFCC } .LINKSON { display: inline; font-family: Verdana,Arial,San Serif; font-size: 12px; color: #000080 } </style> <Script Language="VBscript"> Option Explicit DIM menuID,menuObj,cellBk SUB ShowHide(menuID) menuObj = "Link" & menuID cellbk = "Head" & menuID if document.all.item(menuObj).className = "LINKSON" then 'IF MENU OPEN THEN CLOSE document.all.item(menuObj).className = "LINKSOFF" document.all.item(cellBk).style.backgroundColor = "#0000FF" ' SET CELL BACKGROUND COLOUR BLUE ELSE document.all.item(menuObj).className = "LINKSON" ' OPEN MENU document.all.item(cellBk).style.backgroundColor = "#3366FF" ' SET CELL BACKGROUND COLOUR RED </Script>
Net zo makkelijk |