You are here:  » No Images? Is there a solution?


No Images? Is there a solution?

Submitted by philstone on Fri, 2006-03-03 16:02 in

Hi Everyone

Was wondering is there a script that would replace images not loading with a standard image to prevent an ugly empty box appearing everytime an image doesn't load? probably asking the impossible here? with little php knowlege i am not sure if such a script is makeable.

I will leave it with you for thought

phil

Submitted by support on Fri, 2006-03-03 19:45

The problem with this Phil is making the decision about when you give up on an image load and display an alternative image instead. There are possibily 2 ways to go about this using JavaScript; neither straight forward i'm afraid and involving the use of timers to trigger a re-write of the image URL if the onLoad event has not occured within a given timeframe.

In other words; probably doable; but I don't think the result would look as good as you would like, particularly as there will have to be delay (to give the real image a chance to load); and then the alternative image jumping in - I think it could distract the viewer - perhaps when they were about to click a link....

Submitted by daviddoig on Sat, 2006-03-04 13:14

I know it is not perfect but you could provide a background img stating "no image" or something like that place in your css and it will be shown if there is no image shown, the only thing is there is still the img border etc, not that good and also you are placing a background image of all images, and then also if you are using that to generate background images for site layout and design it would not really work.