473,461 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

bad loading image -> SAFARI

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

Feb 4 '07 #1
1 3389
ag*********@gmail.com 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.

<snip>
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

<snip>
<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>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 4 '07 #2

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

Similar topics

5
by: OneSolution | last post by:
Hi All, Here's what I'm trying to do. I have a diverse customer base, and as it grows, it's increasingly harder to figure out what aspect of our web site is selling and what is not. So I've...
2
by: Mekon | last post by:
I have never written a line of script in my life but I need some help with it now. I have this auto generated code which I want to modify if possible The script generates a strip of...
4
by: Adrian MacNair | last post by:
Hi, I created an image gallery which displays 63 images in a slideshow. The problem is that the show was slow because each image loaded one at a time during the show. No problem right? I just...
4
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup...
6
by: Ivan Bútora | last post by:
I have recently looked at http://alistapart.com/articles/imagegallery to implement a simple picture gallery on a webpage that I'm working on. Everything works fine; however, I have one question....
5
by: toffee | last post by:
Hi all, I've seen a really cool effect which i would like to use on an intranet site. Am referring to the 'LOADING..' animation you see when switching pages. I've seen it somewhere on a website...
0
by: speedcoder | last post by:
hi all, i'm stumped. my applet used to load images over the network. (it was actually designed by someone else.) yes, the applet used to load each image file independently over the network and...
5
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
We have a page that is loading very slow. There is not a lot of data, not a lot of users are connected at the same time and the page does not produce an error, so I am not sure where to start to...
1
by: mlikesit | last post by:
I am trying to get the following code to pre-load some images before re-dirrecting the user. The problem is that the onError event gets called for all of the images immediately. I've tripple...
4
by: Sophy | last post by:
Hi folks, Now, I am facing problem with canceling image loading. I have tried: var img = new Image(); img.src = "path/to/the/image"; // and then I set the img.src to another source
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.