images w IE i Firefox i innych przegl±darkach

K

K.

Witam!

Napisalem taka oto funkcje:


function img_Pokaz(adres,formName,hint_img)
{
eval('document.'+formName+'.'+hint_img+'.src = "'+adres+'"');
}


i wplotlem go w znacznik img

<img src="images/Zareczyny.gif" width="165" height="50" alt=""
usemap="#Mapa_menu_zareczyny" border="0" name="zareczyny"
onMouseOver="img_Pokaz('images/Zareczyny_kolor.gif','form_glowny','zareczyny');"
onMouseOut="img_Pokaz('images/Zareczyny.gif','form_glowny','zareczyny');" />


Problem w tym, ze na IE 7.0. dziala wszystko ok, a na Firefoxie niestety nie
podmieniaja sie gify i menu daje efekt menu statycznego.

Jak powinienem zmodyfikowac wiec funkcje img_Pokaz by dostosowac ja do
wszystkich przegladarek?

Z gory dzieki za posta
Pozdrawiam
M.
 
K

K.

U¿ytkownik "K. said:
Witam!

Napisalem taka oto funkcje:


function img_Pokaz(adres,formName,hint_img)
{
eval('document.'+formName+'.'+hint_img+'.src = "'+adres+'"');
}


i wplotlem go w znacznik img

<img src="images/Zareczyny.gif" width="165" height="50" alt=""
usemap="#Mapa_menu_zareczyny" border="0" name="zareczyny"
onMouseOver="img_Pokaz('images/Zareczyny_kolor.gif','form_glowny','zareczyny');"
onMouseOut="img_Pokaz('images/Zareczyny.gif','form_glowny','zareczyny');"
/>


Problem w tym, ze na IE 7.0. dziala wszystko ok, a na Firefoxie niestety
nie podmieniaja sie gify i menu daje efekt menu statycznego.

Jak powinienem zmodyfikowac wiec funkcje img_Pokaz by dostosowac ja do
wszystkich przegladarek?

Z gory dzieki za posta
Pozdrawiam
M.

Here is the transaltion of my problem
Hello!

I wrote such Javascript function:

function img_Show(adres,formName,hint_img)
{
eval('document.'+formName+'.'+hint_img+'.src = "'+adres+'"');
}


and added into img element:

<img src="images/Zareczyny.gif" width="165" height="50" alt=""
usemap="#Mapa_menu_zareczyny" border="0" name="zareczyny"
onMouseOver="img_Show('images/Zareczyny_kolor.gif','form_glowny','zareczyny');"
onMouseOut="img_Show('images/Zareczyny.gif','form_glowny','zareczyny');" />


There is a problem because it works fine in IE 7.0., but on Firefox not fine
and there are
no replace for gif on menu and it gives such effect that menu is static


How should look like img_Show function to fit it into all web browsers?

Thank you in advance for post
Cheers
M.
 
R

RalfWeb1

Hello K,
function img_Show(adres,formName,hint_img)
{
eval('document.'+formName+'.'+hint_img+'.src = "'+adres+'"');

}

Maybe try this:

document.getElementByName(hint_img).src = adres;

Not tested, but I think it works in all new browsers (DOM).

greetz, Ralf...
 
K

K.

U¿ytkownik said:
Hello K,


Maybe try this:

document.getElementByName(hint_img).src = adres;

Not tested, but I think it works in all new browsers (DOM).

greetz, Ralf...


Unfortunately it doesn`t work either.

Marcin
 
R

RalfWeb1

Hello K,
Unfortunately it doesn`t work either.

Okay, I tried it now with not 'name', but 'id'.

Use the ID-attribut in the img element and use the getElementById()
function.
like: <img src='...' id='zareczyny' ...>

document.getElementById('zareczyny').src = varValue;

It works with .alt, I think also with .src .

have a nice day!
 
K

K.

Uzytkownik said:
Hello K,


Okay, I tried it now with not 'name', but 'id'.

Use the ID-attribut in the img element and use the getElementById()
function.
like: <img src='...' id='zareczyny' ...>

document.getElementById('zareczyny').src = varValue;

It works with .alt, I think also with .src .

have a nice day!

It doesn`t work for both getElementById and getElementByName.

I think I shoul do this by adding some CSS service.

Have a nice day too
Marcin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top