|
-
May 30th, 2004, 06:33 PM
#1
Thread Starter
Junior Member
Javascript works in Firefox & not in IE???
Hi all,
Im have a problem getting this code to work in IE, it works perfectly in Firefox. Any help much appricated.
Thanks JoePC
Code:
<html>
<head>
<title>DHTML & CSS for the WWW | Creating a Sliding Menu</title>
<script language="JavaScript"><!--
var open = 0;
var slideSpeed = 10;
var object = null;
function setMenu (objectID) {
object = document.getElementById(objectID);
if (open) { fX = -80; cX = 0; open = 0; }
else { fX = 0; cX = -80; open = 1; }
slideMenu(cX,fX);
}
function slideMenu (cX,fX) {
if (cX != fX) {
if (cX > fX) { cX -= slideSpeed; }
else { cX += slideSpeed; }
object.style.left = cX + 'px';
setTimeout('slideMenu(' + cX + ',' + fX + ')', 0);
}
return;
}
// -->
</script>
<style type="text/css"><!--
body {
margin-left: 30px
}
#mainMenu {
top: 0;
left: -80px
}
.menu {
position: fixed;
}
a:link {
color: red;
font: bold 12px "Trebuchet MS", Arial, Helvetica, Geneva, sans-serif
}
--></style>
</head>
<body>
<span id="mainMenu" class="menu">
<table width="100" border="0" frame="frame" cellspacing="0" cellpadding="5" bgcolor="#999999">
<tr>
<td align="right" bgcolor="#cccccc" width="80"><a href="#">Option 1</a></td>
<td rowspan="6" width="10">
<div align="left">
<a href="javascript:setMenu('mainMenu')" onFocus="if(this.blur)this.blur();"><img src="menuTab.gif" height="100" width="15" border="0" /></a></div>
</td>
</tr>
<tr>
<td align="right" width="80"><a href="#">Option 2</a></td>
</tr>
<tr>
<td align="right" bgcolor="#cccccc" width="80"><a href="#">Option 3</a></td>
</tr>
<tr>
<td align="right" width="80"><a href="#">Option 4</a></td>
</tr>
<tr>
<td align="right" bgcolor="#cccccc" width="80"><a href="#">Option 5</a></td>
</tr>
<tr>
<td align="right" width="80"><a href="#">Option 6</a></td>
</tr>
</table>
</span>
</body>
</html>
Thanks again.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|