3

I'm trying to display an image usign holder.js but instead of the image the example image is being shown.

<img src='http://upload.wikimedia.org/wikipedia/sr/0/0c/Firefox-logo.png' data-   src="holder.js/140x140" alt='Thumbnail' class="img-thumbnail img-responsive"/>

Is this the correct method of using holder.js? Can someone post an example for displaying an image using holder.js?

Manoj Sreekumar
  • 680
  • 3
  • 14
  • 30

1 Answers1

9

Not sure why you broke up the data- src like that it should just be:

data-src

I don't see anything else wrong but that.

So to see an example check this out:

http://jsfiddle.net/R22tj/

EDIT

If you wanted to just show the image get rid of the data-src and the image will show up. And if you wanted to specify the height and width you also do that in the HTML. So check out this fiddle. (scroll down on the html section to see the 140x140 image.)

http://jsfiddle.net/jLqd9/1/

Bryce Easley
  • 4,811
  • 2
  • 20
  • 22
  • That was a typo. The fiddle still is not working. It show the image for afew seconds and then show the sample 140x140 image. – Manoj Sreekumar Feb 24 '14 at 17:32
  • @ManojSreekumar okay well I don't understand what you are wanting? Do you want the placeholder to show or do you want the image to show. If you want the placeholder to show then the fiddle that I gave you is working and there is something wrong with your browser compatibility. – Bryce Easley Feb 24 '14 at 18:25
  • 1
    @ManojSreekumar ok check out my updated answer. You just need to get rid of the data-src – Bryce Easley Feb 24 '14 at 21:40
  • Thank you. Bootstrap examples confused me with the use of holder.js – Manoj Sreekumar Feb 24 '14 at 22:37
  • Why `` works but not local images like ``? Image is visible anywhere else! – BentCoder Nov 25 '14 at 23:02