Closed
Bug 237984
Opened 21 years ago
Closed 21 years ago
style.display causes problems in Table
Categories
(Firefox :: General, defect)
Tracking
()
People
(Reporter: yucelsmail, Assigned: bugzilla)
Details
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Build Identifier: Firefix 0.8
try the example
Reproducible: Always
Steps to Reproduce:
<html>
<head>
<title>FireFox tr.style.display BUG</title>
<script>
function toggleDisplay(hallo) {
if(hallo.style.display == 'none')
hallo.style.display = 'block';
else
hallo.style.display = 'none';
}
function toggleRow(node) {
if (node.displayRow) {
node.parentNode.insertBefore(node.displayRow,node.nextSibling);
node.displayRow = null;
}
else {
node.displayRow = node.parentNode.removeChild(node.nextSibling);
}
}
</script>
</head>
<body>
<h1>FireFox tr.style.display BUG</h1>
<hr/>
<p>Head</p>
<p onclick="toggleDisplay(this.nextSibling)" style="cursor:pointer; text-
decoration:underline">this works</p><p s>Hallo</p>
<p>Foot</p>
<hr/>
<table>
<tbody>
<tr>
<td>Head</td>
</tr><tr onclick="toggleDisplay(this.nextSibling)"
style="cursor:pointer; text-decoration:underline">
<td>this does NOT work with FireFox</td>
</tr><tr style="display:none;">
<td>Hallo</td>
</tr><tr>
<td>Foot</td>
</tr>
</tbody>
</table>
<hr/>
<table>
<tbody>
<tr>
<td>Head</td>
</tr><tr onclick="toggleRow(this)" style="cursor:pointer; text-
decoration:underline">
<td>this does work even with FireFox</td>
</tr><tr>
<td>Hallo</td>
</tr><tr>
<td>Foot</td>
</tr>
</tbody>
</table>
<hr/>
</body>
</html>
Updated•21 years ago
|
Severity: blocker → normal
Comment 1•21 years ago
|
||
Change your function to:
function toggleDisplay(hallo)
{
if(hallo.style.display == 'none')
hallo.style.display = '';
else
hallo.style.display = 'none';
}
and it will also work with Mozilla.
*** This bug has been marked as a duplicate of 97506 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•