473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

images w IE i Firefox i innych przeglądarkach

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.
Apr 20 '07 #1
9 1802
K.

Użytkownik "K." <ha************@poczta.onet.plnapisał w wiadomości
news:f0**********@news.onet.pl...
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.
Apr 20 '07 #2
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...

Apr 20 '07 #3
K.

Użytkownik <Ra******@gmx.denapisał w wiadomości
news:11**********************@b58g2000hsg.googlegr oups.com...
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...

Unfortunately it doesn`t work either.

Marcin
Apr 20 '07 #4
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!

Apr 20 '07 #5
K.

Uzytkownik <Ra******@gmx.denapisal w wiadomosci
news:11*********************@y80g2000hsf.googlegro ups.com...
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!
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
Apr 20 '07 #6
It doesn`t work for both getElementById and getElementByName.

Don't know what's wrong with your code, but I used your snippet and
added it to an example html-file.
It works fine.

take a look at: http://www.wonderer.de/test/img_over.html

greetz...

Apr 20 '07 #7
MZ

Uzytkownik <Ra******@gmx.denapisal w wiadomosci
news:11**********************@y80g2000hsf.googlegr oups.com...
>It doesn`t work for both getElementById and getElementByName.

Don't know what's wrong with your code, but I used your snippet and
added it to an example html-file.
It works fine.

take a look at: http://www.wonderer.de/test/img_over.html

greetz...

Thank you for help.
It works now.
I had to change maps positions for Firefox, and set different for IE.
Here is me result:

http://www.slub.zmyslowski.pl/

Thank you Ralf
Marcin
Apr 21 '07 #8
MZ wrote :
Uzytkownik <Ra******@gmx.denapisal w wiadomosci
news:11**********************@y80g2000hsf.googlegr oups.com...
>>It doesn`t work for both getElementById and getElementByName.
Don't know what's wrong with your code, but I used your snippet and
added it to an example html-file.
It works fine.

take a look at: http://www.wonderer.de/test/img_over.html
Here is me result:

http://www.slub.zmyslowski.pl/

Line 17: <script language="Javascript" type="text/javascript">

language is deprecated; just remove language="Javascript"

Line 40: <!--
Just remove the HTML comments; they are unneeded and can create side effects

http://www.javascripttoolbox.com/bes...ices/#comments

I checked your code. All you want is just simple, normal rollovers of
images (of text, by the way, not even true images).
Using images to render text is a deprecated and non-recommendable web
design practice.
So, you do not need image maps (and so many of them) at all and you do
not need a form for your webpage. You misuse image map here. And all of
your image slicing is not helping: they increase number of http
requests: so they slow down rendering of webpage. Also, spacer.gif are
totally deprecated web design practice.

<tr>
<td>
<img src="images/spacer.gif" width="31" height="1" alt="" /></td>
<td>
<img src="images/spacer.gif" width="140" height="1" alt="" /></td>

<td>
<img src="images/spacer.gif" width="120" height="1" alt="" /></td>
<td>
<img src="images/spacer.gif" width="165" height="1" alt="" /></td>
<td>
<img src="images/spacer.gif" width="149" height="1" alt="" /></td>
<td>
<img src="images/spacer.gif" width="150" height="1" alt="" /></td>
<td>

<img src="images/spacer.gif" width="45" height="1" alt="" /></td>
</tr>

Resources for you in Polish:

Zawartość Mozilla Developer Center
http://developer.mozilla.org/pl/docs...C5%82%C3%B3wna

http://mozillapl.org/forum/
Standardy WWW i źle działające strony
Tworzenie stron WWW

GĂŠrard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 21 '07 #9
K. wrote :
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., I examined your webpage

and I am absolutely sure that your webpage
- does not need image maps. Zero image map. None needed.
- does not need table or table layouts; just 3 centered <div>s
- does not need spacer.gif; Zero spacer.gif
- does not need javascript at all; no javascript functions; just an
:hover css rule for 5 links and that's it, that's all.

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 21 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Laurent Compere | last post by:
Hi all, I try to make a logo fade in. I wrote the code below that is simple and supposed to be compatible with IE6,Firefox and Netscape. It works pretty well under IE6 but under Firefox and...
61
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the...
2
by: cbjewelz | last post by:
Hey all. So I'm having problems with cross browser alignments. I'm looking at Safari and Mozilla Firefox. I develop in Safari and so it looks perfect there however in Firefox my vertical...
7
by: 80s.arcade | last post by:
Hi. Please take a look at this page: http://tinyurl.com/s2l8w In IE6, putting the mouse on each of the two items highlights the word in a blue (different image) and shows a tool tip. In...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
11
by: davecph | last post by:
I'm constructing a website with a layout created with div-tags. They have a fixed width, float left, and display inline. When one of the div's contain a select-element the right-most div floats down...
8
by: McKirahan | last post by:
Why does the following happen? How can it be suppressed? Under Firefox, use the left-mouse button to drag any image into the textarea and 52 copies of the image's URL appear! <html> <body>...
1
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.