How to add a “loading” icon to your larger images

Let’s say that you have a large image (or several large images) on a particular page, and you want to let visitors know that the image is loading. You could use a piece of javascript to embed a “loading” image for all images that have not yet loaded, but unless you are loading a ton of very large images on a single page, we have a much simpler (and cleaner) method to accomplish the same thing.

Step 1: Find a preload image.

There are many fantastic sites out there that will allow you to create your own preload images. Our favorite is here. Just remember not to choose an icon that is too large (file size), or it may not load until after the larger image has loaded. Here is the one that we have created:

loading image


Step 2: Create the CSS

There is just a little bit of code to create here, and it can be pasted directly into your stylesheet. Just be sure to replace the “youricon.gif” text with your image name.

Code to paste into your stylesheet:
.load{background:url('images/youricon.gif') no-repeat center;}

Step 3: Applying the code
There are a couple of ways to do this, but this is probably the best solution (depending on your application). Simply encase the image you are interested in loading within a “load” div, and apply the width and height of your image to the div.

Here it is applied to an image:
Example:

You will likely need to clear your cache and reload this page to see the loading icon appear. A more thorough example of this loading icon in action can be found here.

a very large image

As mentioned by contributor Lim Chee Aun below, you could also bypass the div and apply the .load class directly to the image itself, and here’s how you can do it:
alternate text

The reason we hadn’t mentioned this idea initially, is if the image does not load it can break the look of the design. If you are absolutely positive you will not have any loading issues, you don’t care if the image needs to be centered (while validating xhtml strict), or if you are applying the class to multiple images, this may be a cleaner solution for you. See our updated example page below for examples of the method created both ways.

If this solution doesn’t fix the problem for you application, let us know what you are doing differently and we’ll be happy to go into more detail.

Compatibility:
This method has been tested in and is compatible with Internet Explorer 5.5, 6, 7, Firefox (PC and Mac), Netscape and Safari (PC and Mac).

That’s all folks!

If you have an idea or article that you would like to contribute, send it on! We’re always looking for good, quality articles. Note that we will not republish an article that has been published elsewhere, so keep it original!


When Everything Goes Wrong....

http://www.photographyblog.com/images/photo_of_the_week/28040508/Sorrow.jpg

In times of pain
When everything ends in vain,
When all dreams seem washed in rain,
Just count what will remain
And believe there is lot to gain.

When loneliness haunts you,
When whole world seems hostile,
Just close your eyes and believe,
There will be someone,
For whom you will be the world.

If bitter words haunt you,
And terrible scorns hurt you,
Just believe in yourself and smile,
For belief is one virtue,
That surely leads to zenith.

Its a whole new day.

On a sunny morning,
I opened my eyes,
To see the word filled with life.
All shadows of past glided away,
And glow of future mentored the way.

There were days when skies were dark,
There were days when joy seemed afar.
But the secret of life,
Has given a whole new life,
The one life to be loved unfathomed.

Everyday is now a clear sky,
With no stains from past,
With colorful dreams on mast.
Its really a whole new day,
Like a life on a sunny bay.

Its the secret of joy,
That gave me true joy.
Love your life,
Love the world,
It'll then be a whole new world.

Why i didnt get girl friend?

The often repeated topic. It seems to be a mystery until I really start thinking. One of my personal favorites. Why some men can never fall in love or never get girl friends. Many of us just keep complaining, without thinking on what the inherent problem is and found out some important issues which might concur with a majority of ppl who are rocking the same boat as mine.

1) I always sit in the last bench with the other class comrades who feel that it’s possible to get marks sitting in last row. In case of workplace, no girls are there in my project and I have like minded ppl like me as colleagues and wherein my entertainment oscillates between the play stations and cinema theaters.

2) I obviously cant groove and dance, and dance around in a group in a disc by just shaking my head or grooving my hip. Desi music directors are my favorites. I cant wait for a bangra number to crop up. Unfortunately, I am too adept at dancing dappankuthu or Desi dance, not the Americanized western hip hop dance.

3) I perceive discotheque to be a place where I will have a chance to unleash my dancing potential (dappankuthu) and occupy the center stage with 10 other fellow rogues, immediately throwing out the babes from the vicinity of the dance floor. This automatically repels the women from me (they consider me as out of civilization. But, unfortunately we think that we are the only ppl who can really dance)

4) My Intelligence quotient mostly can take in just Jackie Chan, Arnold and Stallone flicks. It can take in just action films whose contents can be absorbed. I just can't take any English Romance films. Desi romance rocks. We invariably are the DDLJ and Hum Aapke Hai Kaun types. Shahrukh, Rajni, Chiranjeev,Kamal, Mohanlal, Mammotty rock. Tom Cruise is a dud!!! and invariably ***...(obv..its becoz of jealousy)

5) I can’t eat Spanish, Chinese foods and my fav restaurant invariably happens to be Saravana Bhavan, Anandha Bhavan, Shanthi-Sagar types. Of coz we cant forget Karpagam Mess, Mami's kadai and Murugan Idly. We frankly are clueless as to what are Bella Ciao, Wang's kitchen and things like that, unless we happen to go an a treat organized by the other guyz.

6) I don't see a reason why I have to go to Barristas or Qwiky's when the local corner "Nair Kadai Chaaya" tastes like nectar and satisfies I more than a Barristas. Lime tea is the best tea to have been invented by an human and I are thankful to nair for providing it to I.

7) Most of the jokes I know are adult or the local jokes which I can discuss only with my other fellow comrades and which again takes the opportunity from telling a joke to the girl and impressing her. But when I seriously tell very good jokes, the blondes can't comprehend. I have to tell some absolutely "Kadi jokes" (terrible bores) to make them laugh, which I try however, will never come close to.

8) I obviously don't know how to make use of Yahoo Messenger, and I use it to scold my online friends with the best choice of invectives, ask them to book the latest movie tickets. I unfortunately don't know how to flirt using Yahoo Messenger and are frequently at loss of topics when I want to chat with some girl. Whereas I am deluged with strange topics to discuss with my friend with whom I had lost touch for the past decade or so.

9) While chatting in messenger, I seriously cant start a topic with a girl. I have seen guyz chatting with girls purely with emoticons for more than an hour. I can never do that. I will have to crack real dumb jokes to start the conversation or falsely extol them. And bet, I can't do the following: Boy : What did you have for breakfast??Girl : I had idli .....Boy: Is it??? Same pinch, no back pinch, I too had idli. (he pinches her) and laughs.Girl : Ouchhh (artificially). It hurts.Boy: Ohh.. I am sorry and (tries to apologise).............then says "I had sambhar for idli."Girl: (excitedly)..Sambharrrrrrrr............ i had chutney....and giggles... I swear, I cant tolerate any longer than this................ And this is not a figment of imagination, by any means. I have seen this...Though I agree there may be exceptions...

10) I cant sing a Bryan Adams, Sting, George Michael's song. When someone talks about Linking Park, I cannot even imagine who they are and the closest link I can associate with them is Cubbon Park.

11) I seriously am clueless as to what rock music is.

12) All through college life, I belong to this boyz gang and even in my gang, nobody has a girlfriend. So there is absolutely an absence of the inspirational factor. With ALL these attributes, it is difficult for guyz like me to fall in love or find a girl. But it is not a sin after all. I guess we are not made for it. We are one among the few in the vanishing tribe. Let us accept that and be proud of that...

We have THE uniqueness that we remain single till we get married and having that trait is really a virtue and who knows, we might be the elite clique in the future. So all those of ppl like me who feel sad that they dont have Gf's, just chill!!! We are not made for it and I swear that for our characteristics,
a GF would not have added any value addition and we are better off staying single till 28 or 30 :-).

15 things you probably never knew or thought about...

1. At least five people in this world love you so much they would die for you.
2. At least fifteen people in this world love you in some way.
3. The only reason anyones would ever hate you is because they want to be just like you.
4. A smile from you can bring happiness to anyone, even if they don't like you.
5. Every night, someone thinks about you before they go to sleep.
6. You mean the world to someone.
7. If not for you, someone may not be living.
8. You are special and unique.
9. Someone that you don't even know exists loves you.
10. When you make the biggest mistake ever, something good comes from it.
11. When you think the world has turned its back on you, take a look: you most likely turned your back on the world.
12. When you think you have no chance of getting what you want, you probably won't get it, but if you believe in yourself, probably, sooner or later, you will get it.
13. Always remember the compliments you recieved. Forget the rude remarks.
14. Always tell soemone how you feel about them; you will feel much better when they know.
15. If you have a great friend, take the time to let them know that they are great.