coder24
04-28-2006, 12:13 AM
Hello, I have programmed the following:
<html>
<body>
<head>
<script type="text/javascript">
function expandTaskMenu()
{ var x=document.getElementById('taskMenu');
x.innerHTML = "<table border=1 cellpadding=0 cellspacing=0 width=85%>";
x.innerHTML += "<tr><td>align=center width=100%><b><a href='javascript:collapseTaskMenu()' style='text-decoration: none'>Collapse</a></b></td></tr>";
x.innerHTML += "<tr><td>Sample 1</td></tr><tr><td>Sample 2</td></tr></table>";
}
function collapseTaskMenu()
{ var x=document.getElementById('taskMenu');
x.innerHTML = "<table border=0 cellpadding=0 cellspacing=0 width=85%>";
x.innerHTML += "<tr><td align=center width=100%><b><a href='javascript:expandTaskMenu()' style='text-decoration: none'>Expand</a></b></td></tr></table>";
}
</script>
</head>
<table border=1>
<tr><td id="taskMenu">
<table border="0" cellpadding="0" cellspacing="0" width="85%">
<tr>
<td align="center"width="100%">
<b><a href="javascript:expandTaskMenu()">Original</a></b>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
When in Mozilla, with each subsequent click, the text moves down the page.
In IE, the text does not move but the "submenu" items print sideways instead
of down. I have no idea why either of these things happen. As I do not do much Javascript programming, any help would be very much appreciated.
Thank-you.
<html>
<body>
<head>
<script type="text/javascript">
function expandTaskMenu()
{ var x=document.getElementById('taskMenu');
x.innerHTML = "<table border=1 cellpadding=0 cellspacing=0 width=85%>";
x.innerHTML += "<tr><td>align=center width=100%><b><a href='javascript:collapseTaskMenu()' style='text-decoration: none'>Collapse</a></b></td></tr>";
x.innerHTML += "<tr><td>Sample 1</td></tr><tr><td>Sample 2</td></tr></table>";
}
function collapseTaskMenu()
{ var x=document.getElementById('taskMenu');
x.innerHTML = "<table border=0 cellpadding=0 cellspacing=0 width=85%>";
x.innerHTML += "<tr><td align=center width=100%><b><a href='javascript:expandTaskMenu()' style='text-decoration: none'>Expand</a></b></td></tr></table>";
}
</script>
</head>
<table border=1>
<tr><td id="taskMenu">
<table border="0" cellpadding="0" cellspacing="0" width="85%">
<tr>
<td align="center"width="100%">
<b><a href="javascript:expandTaskMenu()">Original</a></b>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
When in Mozilla, with each subsequent click, the text moves down the page.
In IE, the text does not move but the "submenu" items print sideways instead
of down. I have no idea why either of these things happen. As I do not do much Javascript programming, any help would be very much appreciated.
Thank-you.