twitter-bootstrap 使用 holder.js 显示图像缩略图
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21942404/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Using holder.js to display image thumbnails
提问by Manoj Sreekumar
I'm trying to display an image usign holder.js but instead of the image the example image is being shown.
我正在尝试显示一个图像 usign holder.js 但正在显示示例图像而不是图像。
<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?
这是使用holder.js 的正确方法吗?有人可以发布一个使用 holder.js 显示图像的示例吗?
回答by oueasley
Not sure why you broke up the data- srclike that it should just be:
不知道你为什么分手了data- src,它应该是这样的:
data-src
I don't see anything else wrong but that.
除了那个,我没有看到任何其他错误。
So to see an example check this out:
因此,要查看示例,请查看:
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.)
如果你只想显示图像,去掉 data-src,图像就会显示出来。如果您想指定高度和宽度,您也可以在 HTML 中执行此操作。所以看看这个小提琴。(向下滚动 html 部分以查看 140x140 图像。)

