Nedals
03-21-2004, 04:31 PM
Here's a simple script. Click on 'Up' and the text moves up.
This works in IE6 and Opera but will NOT work in NS7. Interestingly, if I remove the DocType it works in NS7. (I also tried it with 'DTD HTML 4.01 Transitional' and it doesn't work).
Any Thoughts?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<script type="text/javascript">
<!--
y = 350;
function moveit(dir) {
var page = document.getElementById('frame').style;
y -= 10;
page.top = y;
return false;
}
//-->
</script>
</head>
<body style="margin:0px; padding:0px; background-color:#fff;">
<div style="position:absolute; top:50px; left:200px; width:400px; height:400px; text-align:center; border:1px solid #000">
<a href="#" onclick="return moveit('U')">Up</a>
</div>
<div id="frame" style="position:absolute; top:350px; left:350px;">Moving Text</div>
</body>
</html>
This works in IE6 and Opera but will NOT work in NS7. Interestingly, if I remove the DocType it works in NS7. (I also tried it with 'DTD HTML 4.01 Transitional' and it doesn't work).
Any Thoughts?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<script type="text/javascript">
<!--
y = 350;
function moveit(dir) {
var page = document.getElementById('frame').style;
y -= 10;
page.top = y;
return false;
}
//-->
</script>
</head>
<body style="margin:0px; padding:0px; background-color:#fff;">
<div style="position:absolute; top:50px; left:200px; width:400px; height:400px; text-align:center; border:1px solid #000">
<a href="#" onclick="return moveit('U')">Up</a>
</div>
<div id="frame" style="position:absolute; top:350px; left:350px;">Moving Text</div>
</body>
</html>