bad loading image -> SAFARI

A

agatha.life

I did a javascript for the loading of images (I didn't want to have
the images loaded in "on loading" because they are too many).

The website is for a model and if you look at the codeof pages ( for
ex. http://www.agathamoon.com/gallery_48_eng.htm ) using explorer or
firefox it works, with safari it doesn't! :(

The idea is to have the word "loading" appearing while going from an
image to another.

Here it's what there's in the head:


<script>
function imgLoad(myImg)
{
showLoading();
newImage = new Image();
newImage.src = myImg;
document.images['image_big_on'].src=myImg;

if (newImage.complete )
showImage();
else
newImage.onload=showImage;
}

function showLoading()
{
document.images['image_big_on'].style.display='none';
document.all.warning.style.display='inline ';
}

function showImage()
{
document.all.warning.style.display='none';
document.images['image_big_on'].style.display='inline';
}
//-->
</script>

Here how the script appears durind the loading in the body:

<td align="center"><SPAN class="index" id=warning style="DISPLAY:
none">Loading image...</span><img src="img/gallery/a_o/cover.jpg"
name="image_big_on" border="0" id="image_big_on"></td>

and here I recall the javascript in the body:

<A href="javascript:imgLoad('img/gallery/a_o/01.jpg');"><img
src="img/gallery/a_o/01_thumb.jpg" width="40" height="40"
border="0"></a>

Do you know what's wrong with the process?

Being the site of a model it's visited by lots of photographers, a big
part of them uses a mac and safari.

I thank you very much for your help.

AM
www.agathamoon.com
 
R

Randy Webb

(e-mail address removed) said the following on 2/3/2007 7:29 PM:
I did a javascript for the loading of images (I didn't want to have
the images loaded in "on loading" because they are too many).

The website is for a model and if you look at the codeof pages ( for
ex. http://www.agathamoon.com/gallery_48_eng.htm ) using explorer or
firefox it works, with safari it doesn't! :(

Stop using IE proprietary code and it will probably work in Safari. The
only reason it "works" in Firefox is because Firefox put in support for
document.all so that pages written by IE centric people could still be
viewed.

function showLoading()
{
document.images['image_big_on'].style.display='none';
document.all.warning.style.display='inline ';
document.getElementById('warning').style.display

}

function showImage()
{
document.all.warning.style.display='none';
document.images['image_big_on'].style.display='inline';

document.getElementById('warning').style.display

<A href="javascript:imgLoad('img/gallery/a_o/01.jpg');"><img
src="img/gallery/a_o/01_thumb.jpg" width="40" height="40"
border="0"></a>

<URL: http://jibbering.com/faq/index.html#FAQ4_24>
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top