Ik heb een probleem met een menu met allemaal divjes. Ik wil met onmouseover in het menu een layer tussen de verschillende divjes laten verschijnen. Maar als je dus niet met de mouse op de link staat dat de div dan gewoon ook geen ruimte in neemt in het menu. Dit alles om een soort sub-menu te maken.
Ik heb nu deze code :
Voor de werking hier een url:
http://stormvogels.veendam.org/test2.html
Ik hoop dat iemand mij tips kan geven hoe ik dit het beste kan oplossen.
Ik heb nu deze code :
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
| <html>
<head>
<style>
div {font-family:tahoma; font-size:8pt;}
.container {border: 1 solid gray; background-color:#E0E0E0; padding:2; width:100px;
filter:progid:DXImageTransform.Microsoft.Shadow(color='#666666', Direction=135, Strength=4)}
.menuItem {border:1 solid #E0E0E0; background-color:#E0E0E0; padding:1; width:100px;}
.menuOver {border:1 solid gray; background-color:#D0D0D0; padding:1; width:100px;}
#onzerenners {height:30;visibility:hide;visibility:hidden;}
</style>
<script language="javascript">
var ie4 = ( document.all ) ? true : false;
var ns6 = ( !ie4 && document.getElementById ) ? true : false;
var ns4 = ( !ie4 && !ns6 && document.layers ) ? true : false;
function getStyleOf ( id )
{
return ie4 ? document.all [ id ].style
: ns4 ? document.layers [ id ]
: ns6 ? document.getElementById ( id ).style
: null;
}
function layer ( id, onoff )
{
theStyle = getStyleOf ( id );
if ( theStyle != null )
theStyle.visibility = onoff ? "visible" : "hidden";
}
function changeState(obj, how) {
obj.className = (how)? "menuOver":"menuItem";
}
</script>
</head>
<body>
<DIV class="container">
<DIV class="menuItem" onmouseover="changeState(this,true);
layer( 'onzerenners', true ); return false;" onmouseout="changeState(this);
layer( 'onzerenners', false ); return false;">Onze renners</DIV>
<DIV class="menuItem" id="onzerenners">
<tr>
<td>test</td></tr>
<tr><td>test2</td></tr>
</DIV>
<DIV class="menuItem" onmouseover="changeState(this,true)"
onmouseout="changeState(this)">Uitslagen</DIV>
<DIV class="menuItem" onmouseover="changeState(this,true)"
onmouseout="changeState(this)">Informatie</DIV>
</DIV>
</body>
</html> |
Voor de werking hier een url:
http://stormvogels.veendam.org/test2.html
Ik hoop dat iemand mij tips kan geven hoe ik dit het beste kan oplossen.