WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   Warum funkt das nicht in NS? (http://www.wcm.at/forum/showthread.php?t=153756)

coolbininet 21.12.2004 19:30

Warum funkt das nicht in NS?
 
Habe folgenden Code geschrieben und weis nicht, warum er nicht im Netscape klappt, bitte helft mir!

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<meta name="description" content="ich">
<meta name="keywords" content="ich">
<meta name="author" content="ich">
<meta name="generator" content="notepad">
</head>
<body onload="start();" >
<div id="rahmen" style="left: 120px; position: absolute; top: 100px">runde</div>
<script language=javascript type=text/javascript>
<!-- Begin
var xPos = 100;
var step = 1;
var delay = 30;
var yPos = 100;
var height = 0;
var offset = 0;
var yon = 0;
var name = navigator.appName;
if (name == "Microsoft Internet Explorer") {
yPos = document.body.clientHeight;
rahmen.style.top = yPos;
}
else {
yPos = window.innerHeight;
rahmen.pageX = xPos;
rahmen.visibility = "hidden";
}
function changePos() {
if (yon == 0) {xPos = xPos + step; if (xPos == 280) {yon = 1;}}
if (yon == 1) {yPos = yPos + step; if (yPos == 315) {xPos = 280; yon = 2;}}
if (yon == 2) {xPos = xPos - step; if (xPos == 80) {yPos = 315; yon = 3;}}
if (yon == 3) {yPos = yPos - step; if (yPos == 82) {xPos = 80; yon = 0;}}
if (name == "Microsoft Internet Explorer") {height = document.body.clientHeight; offset = rahmen.offsetHeight;}
else {height = window.innerHeight; offset = document.rahmen.clip.height;}
if (yPos < 0) {yon = 1; yPos = 0;}
if (yPos >= (height - offset)) {yon = 0; yPos = (81);}
if (name == "Microsoft Internet Explorer") {rahmen.style.left = xPos; rahmen.style.top = yPos + document.body.scrollLeft;}
else {documentgetElementById("rahmen").pageX = xPos; rahmen.pageY = yPos + window.pageYOffset;}
}

function start()
{
if (name != "Microsoft Internet Explorer") {
rahmen.visibility = "visible";
}
loopfunc();
}
function loopfunc()
{
changePos();
setTimeout('loopfunc()',delay);
}
// End -->
</script>
<div style="position: absolute; top: 100px; left: 120px; z-index: 100">VVVVVVVVVVVVVV</div>
<div style="position: absolute; top: 300px; left: 120px; z-index: 100">VVVVVVVVVVVVVV</div>
</body>
</html>



mfg

Coolbininet

T.dot 21.12.2004 20:11

HTML Code von W3C Validator überprüfen lassen

http://validator.w3.org

<script> Tags gehören in Head, nicht in Body

Deinen Javascriptcode hab ich jetz ned überprüft ;)

mfg Thomas


Alle Zeitangaben in WEZ +2. Es ist jetzt 11:43 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag