# "Loading Image"-Image

**URL:** <https://www.ruby-forum.com/t/loading-image-image/75661>\
**Category:** Rails\
**Created:** [November 12, 2006, 1:28am UTC](https://www.ruby-forum.com/t/loading-image-image/75661 "2006-11-12T01:28:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henrik\_Jensen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/65b543/32.png) [@Henrik\_Jensen](https://www.ruby-forum.com/u/Henrik_Jensen)\
**Post date:** [November 12, 2006, 1:28am UTC](https://www.ruby-forum.com/t/loading-image-image/75661/1 "2006-11-12T01:28:16Z")

</div>

So - I really need some help on this guys (and girls?) 🙂

I have a Image gallery which, by it’s nature, requires to load a lot of  
images at the same time. Instead of just showing an empty place, and  
some text while the images is loading it would be really nice with a  
“now loading” image which later gets replaced by the real image.  
If you don’t understand me i think that deviantart have a feature like  
this.

How do you do anything like this - the rails way?

thanks in advance

Henrik

---

<div class="post-metadata">

**Author:** ![Henrik\_Jensen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/65b543/32.png) [@Henrik\_Jensen](https://www.ruby-forum.com/u/Henrik_Jensen)\
**Post date:** [November 12, 2006, 6:42pm UTC](https://www.ruby-forum.com/t/loading-image-image/75661/2 "2006-11-12T18:42:37Z")

</div>

You could use the CSS feature to put a “placeholder” image as the  
background, and then when it loads the real image it will be on the top  
of it so to speak.

the CSS Code looks something like this

.imagebox{  
background-image: url (“somestockimage.jpg”);  
background-repeat: no-repeat;  
width: 100px;  
height: 100px;}

Hope that helps,  
Jessica

---

<div class="post-metadata">

**Author:** ![Henrik\_Jensen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/65b543/32.png) [@Henrik\_Jensen](https://www.ruby-forum.com/u/Henrik_Jensen)\
**Post date:** [September 4, 2007, 2:58am UTC](https://www.ruby-forum.com/t/loading-image-image/75661/3 "2007-09-04T02:58:11Z")

</div>

Sassy8877 wrote:

> You could use the CSS feature to put a “placeholder” image as the  
> background, and then when it loads the real image it will be on the top  
> of it so to speak.
> 
> the CSS Code looks something like this
> 
> .imagebox{  
> background-image: url (“somestockimage.jpg”);  
> background-repeat: no-repeat;  
> width: 100px;  
> height: 100px;}
> 
> Hope that helps,  
> Jessica

That works. For my site, I don’t have a fixed width and height, so I use  
javascript for that.
