[Javascript] changing image src

Chris Tifer christ at saeweb.com
Fri Jun 20 10:03:16 CDT 2003


Have you tried changing this:

>  document.bt_02.src = '_img/bt_02radio_off.gif';

To:

document.images["bt_02"].src = 'image/path/file.gif"

That might be it.

Chris Tifer
http://emailajoke.com

----- Original Message -----
From: "Marcelo Simon" <grillo at lazzuri.com.br>
To: "* Yahoo / Javascript" <javascript at LaTech.edu>
Sent: Friday, June 20, 2003 10:32 AM
Subject: [Javascript] changing image src


> Hi all,
>
> Please help me on this:
>
> I have a menu on my page with 3 images, on click I want them to change
it's
> src attribute and load 4 diferent pages on 4 diferente frames, so I've
> created this function here:
>
> function midiaext(){
>  parent.img.location.href='04_midiaext/04_00_img.htm';
>  parent.txt.location.href='04_midiaext/04_txt.htm';
>  parent.tit.location.href='04_midiaext/04_tit.htm';
>  parent.nota.location.href='04_midiaext/04_00_nota.htm'
>  document.bt_02.src = '_img/bt_02radio_off.gif';
>  document.bt_03.src = '_img/bt_03internet_off.gif';
>  document.bt_04.src = '_img/bt_04midiaext_on.gif';
> }
>
> it is changing the pages, but it isn't changing the image src. I'd added
an
> alert(document.bt_04.src); that is showing me the image name so I'm 100%
> sure that the DOM is correct, this is my button
>
>  <td><a href="#" onClick="midiaext(); return true;"><img
src="_img/nada.gif"
> name="bt_04" width="143" height="33" border="0"
> onMouseOver="MM_swapImage('bt_04','','_img/bt_04midiaext_on.gif',1)"
> onMouseOut="MM_swapImgRestore()"></a></td>
>
> Please advice, this website is due today, and this is the last quirk to
> resolve.
>
> Thanks in advance
> Marcelo Simon
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list