Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display the word LOADING while image loads

Status
Not open for further replies.

mamarockstar

Technical User
Aug 24, 2005
18
US
I have a photography website and I want to get my slideshow on the home page to display the word "Loading..." while the slideshow loads. Right now a red "X" displays in the top left corner until the show is loaded. It doesn't take long, but I don't want people to think it's not working when they see the "X".

Here's the site:
Appreciate the help!

Dennielle
 
The simplest way by far is to give your image an alt attribute with the value "Loading":

Code:
<img src="whatever.gif" alt="Loading">

It's not the best solution in the world (unstyleable (sp?)), but it would be better than the red cross by itself.

A better way would be to have a div/span with the word "Loading" in, which was hidden when the image loads (you can use the onload event of the image object to detect this).

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I have all my images in DIVS. i hide the DIVS while they load. Then unhide them when they are finished. Make sure you let the user know that they are loading...

JavaScript Beginner at work :)
 
<div>
Hello
</div>

Dividers?

The Program to clean the streets...

var chav_health = 100;
var chav = "";

if(person == "chav") {
(for x=1; chav!="dead"; x++) {
kick_chav(x)
}
}

function kick_chav(amount_of_kicks){
alert("Your gonna die");
kick_chav_hard(amount_of_kicks);

if(chav_health == 0;){
chav="dead";
}
else{
chav="alive";
}

return chav;
}

func
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top