插件 Holder.js
圖片占位符插件 holder.js 可以為圖片生成一個占位符圖片也可以為某個區(qū)域生成一個占位符圖片。不依賴于 jquery 等第三方庫罐栈。
Holder renders image placeholders on the client side using SVG
.
使用方法:
Include holder.js
in your HTML:
<script src="holder.js"></script>
Holder will then process all images with a specific src
attribute, like this one:
![](holder.js/300x200)
The above tag will render as a placeholder 300 pixels wide and 200 pixels tall.
![](holder.js/300x200)
To avoid console 404 errors, you can use data-src
instead of src
.
PLACEHOLDER
使用方法:
Just put your image size after our URL and you'll get a placeholder image.
Like this:
http://via.placeholder.com/350x150
You can also use it in your code, like this:
<a ><img src="http://via.placeholder.com/350x150"></a>