Helmut Kuhn: geht immer noch nicht mit Netscape 6.2

Beitrag lesen

Hallo Kai

Erstmal Danke für Deine Mühe mir zu Helfen!

Mein Code ist geändert, aber meine Grafiken bewegen sich nur mit dem MSIE. Unter dem Netscape 6.2 tut sich nichts, die Grafiken bleiben an Ihrer .css Position stehen. Ich vermute, da fehlt noch etwas bei if(ns) ..

geändeter Code

.js
<!--
//Triathlon 2 Dimensional
var y1  = 0;
var y2  = 400;
var x  = 0;
var schritt = 1;
var a  = 0;

whatbrowser();
 sety();

function sety()
 {
  if(y1 >= 0 || y1 < 400)
  {
   if(ie)
   {
    document.all["schw"].style.posTop = y1;
    document.getElementById("schw").style.top = y1 + "px";
   }
   if(ns)
   {
    document.layers["schw"].top = y1;
   }
   y1 += schritt;
   window.status = 'Schwimmen:'+y1+' Radfahren:'+x+' Laufen:'+a;
  }
  if(y1 < 0 || y1 >= 400)
  {
   y1 = -100;
   if(ie)
   {
    document.all["bike"].style.left = x;
    document.getElementById("bike").style.left = x + "px";
   }
   if(ns)
   {
    document.layers["bike"].left = x;
   }
   x += schritt;
   window.status = 'Schwimmen:ok Radfahren:'+x+' Laufen:'+a;
  }
  if(x < 0 || x >= 500)
  {
   x = -100;
   if(ie)
   {
    document.all["jogg"].style.posTop = y2;
    document.getElementById("jogg").style.top = y2 + "px";
   }
   if(ns)
   {
    document.layers["jogg"].top = y2;
   }
   y2 -= schritt;
   if(y2 > 0)
   {
    a++;
    window.status = 'Schwimmen:ok Radfahren:ok Laufen:'+a;
   }
  }
  if(y2 <= 0)
  {
   window.status = 'Schwimmen:ok Radfahren:ok Laufen:ok !!Finisher!!';
  }
 }
 setInterval("sety()",10);
 function whatbrowser()
 {
  ns = (document.layers || navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 5)?true:false;
  ie = (document.all)?true:false;
  ns = (document.layers)?true:false;
  ie = (document.GetElementById)?true?false;
 }
//-->

.css
<!--
h2
  {
   color:   #FFFFFF;
   font-size:  15px;
   padding:  3px;
   font-family:  Tahoma,Arial,Helvetica;
   font-weight:  700;
   text-decoration: none;
  }
a
  {
   color:   yellow;
   font-family:  Tahoma,Arial,Helvetica;
   font-size:  10px;
   text-decoration: underlined;
  }
body
  {
   background-color: #203080;
  }
font
  {
   font-color:  #FFFFFF;
  }
table
  {
   font-color:  #FFFFFF;
   color:   #FFFFFF;
  }
#bike
  {
   position:  absolute;
   top:   400px;
   left:   0;
   z-index:  3;
  }
#schw
  {
   position:  absolute;
   top:   0;
   left:   0;
   z-index:  3;
  }
#jogg
  {
   position:  absolute;
   top:   403px;
   left:   500px;
   z-index:  3;
  }

-->