Het volgende script voegt anchors toe aan een element, maar resulteerd dat de hover class niet reageerd? In mozilla werkt het wel, en doet het wat het moet doen, heb ik hier een bug te pakken in IE? ..
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
63
64
65
66
67
68
69
70
71
72
73
74
75
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function tabpage(element){
this.element = element;
this.tabs = [];
}
tabpage.prototype = {
attach:function(objref){
this.element.appendChild(objref);
this.tabs.push(objref);
}
}
function tab(label,element,visible){
this.label = label;
this.element = element;
this.visible = visible;
return this.paint();
}
tab.prototype = {
paint:function(){
var tmp = document.createElement('A');
tmp.appendChild(document.createTextNode(this.label));
if(this.visible){
tmp.className='sel';
}
return tmp;
}
}
</script>
<style type="text/css">
.tabs{
height:40px;
padding: 0 10px;
overflow:hidden;
}
.tabs a{
height:25px;
width:120px;
margin:15px 2px 0 0;
padding:6px 0 0 0;
font: 11px tahoma;
color: #666;
float:left;
text-align:center;
text-decoration: none;
display:block;
}
.tabs a.sel, .tabs a.sel:hover{
margin:12px 2px 0 0;
color: blue;
height:28px;
width:124px;
}
.tabs a:hover{
color:red;
}
</style>
</head>
<body>
<div id="tabs" class="tabs">
<a href="#">predefined</a>
</div>
<script type="text/javascript">
var tp = new tabpage(document.getElementById('tabs'));
tp.attach(new tab('General',document.getElementById('general'),false));
tp.attach(new tab('Story',document.getElementById('story'),false));
tp.attach(new tab('Advanced',document.getElementById('story'),false));
</script>
</body>
</html> |