vern: funktion bildwechsel

hallo

ich hab ein problem

die funktion bildwechsel aus selfhtml funktioniert ja eigentlich mit image-indexnummern.

ich möchts mit bildnamen machen:

bisher hab ich:

mouseover_00 = new Image();
mouseover_00.src = "images/buttons/00_h.gif";
mouseout_00 = new Image();
mouseout_00.src = "images/buttons/00_d.gif";

function Bildwechsel(bildbezeichnung,bildobjekt)
  {
   window.document.bildbezeichnung.src = bildobjekt.src;
   }

im body:

<A HREF="" ONMOUSEOVER="Bildwechsel(pic_00,mouseover_00);" ONMOUSEOUT="Bildwechsel(pic_00,mouseout_00)">
<img src="images/buttons/00_d.gif" width="163" height="22" alt="" border="0" name="pic_00"></a>

aber es klappt nicht ... kann mir jemand den fehler zeigen?

  1. Hi

    Probier es so:

    mfiroff = new Image(); mfiroff.src = "images/off_uns_fir.gif";
    mfiron = new Image(); mfiron.src = "images/on_uns_fir.gif";

    function imgOn(imgName)
    {
    document[imgName].src = eval(imgName +  "on.src");
    }
    function imgOff(imgName)
    {
    document[imgName].src = eval(imgName +  "off.src");
    }

    <a class="intern" href="fir_upt1.htm" OnMouseOver="imgOn('mfir')" OnMouseOut="imgOff('mfir')"><img name="mfir".....></a>

    Wilhelm

    1. vielen dank ... es klappt!!

  2. function Bildwechsel(bildbezeichnung,bildobjekt)
      {
       window.document.bildbezeichnung.src = bildobjekt.src;
       }

    function Bildwechsel(bildbezeichnung,bildobjekt)
    {
    window.document.images[bildbezeichnung].src = bildobjekt.src;
    }

    <A HREF="" ONMOUSEOVER="Bildwechsel(pic_00,mouseover_00);" ONMOUSEOUT="Bildwechsel(pic_00,mouseout_00)">
    <img src="images/buttons/00_d.gif" width="163" height="22" alt="" border="0" name="pic_00"></a>

    <A HREF="" ONMOUSEOVER="Bildwechsel('pic_00',mouseover_00)" ONMOUSEOUT="Bildwechsel('pic_00',mouseout_00)">
    <img src="images/buttons/00_d.gif" width="163" height="22" alt="" border="0" name="pic_00"></a>

    Thomas J.