chris: Code für mouseevent bei netscape?????

Servus,

ich hab ein Problem mit nem Mouseevent auf meiner HP

onmouseover="document.all.modell.src='xy.gif'"
onmouseout="document.all.modell.src='ab.gif'"

sind auch vom IE lesbar aber nicht vom NS

würde gern eine Browserunterscheidung machen, weiß aber nicht wie der Quellcode aussieht, dass NS was damit anfangen kann.

Gruß chris

  1. Servus,

    ich hab ein Problem mit nem Mouseevent auf meiner HP

    onmouseover="document.all.modell.src='xy.gif'"
    onmouseout="document.all.modell.src='ab.gif'"

    sind auch vom IE lesbar aber nicht vom NS

    würde gern eine Browserunterscheidung machen, weiß aber nicht wie der Quellcode aussieht, dass NS was damit anfangen kann.

    if (document.getElementById) // IE 5.x und NN 6
    {browser = 'Dom';}
    if (document.layers) // NN 4.x
    {browser = 'Netscape';}
    if (document.all && !document.getElementById) // IE 4
    {browser = 'Explorer';}

    fuer NS

    wenn Bild nicht in Layer:
    if (browser == "Netscape")
    document[ImgName].src = eval(ImgName +  "off.src");

    wenn bild in Layer:
    if (browser == "Netscape")
    document.layers[LayName].document.images[ImgName].src = eval(ImgName +  "on.src");

    LayName und ImgName sind hier Variable, welche uebergeben werden

    Gruesse
    Wilhelm

  2. <img src="ab.gif" name="BildName" onmouseover="document.BildName.src = 'xy.gif'" onmouseout="document.BildName.src = 'ab.gif'">

    http://selfhtml.teamone.de/javascript/objekte/images.htm, bzw. http://selfhtml.teamone.de/javascript/objekte/images.htm#src

    Gruß
    Norbert

    1. <img src="ab.gif" name="BildName" onmouseover="document.BildName.src = 'xy.gif'" onmouseout="document.BildName.src = 'ab.gif'">

      http://selfhtml.teamone.de/javascript/objekte/images.htm, bzw. http://selfhtml.teamone.de/javascript/objekte/images.htm#src

      Gruß
      Norbert

      jawohl, so funzt es