holder.js的使用
来源:互联网 发布:码字软件 编辑:程序博客网 时间:2024/06/07 15:25
地址:http://www.bootcdn.cn/holder/
使用:<img src="holder.js/300x200" />注意事项:300x200里面的符号是x,不是乘法号
为了避免控制台404错误,您可以使用data-src代替src。<img data-src="holder.js/300x200" />
Placeholder options are set through URL properties, e.g. holder.js/300x200?x=y&a=b
. Multiple options are separated by the &
character.
theme
: The theme to use for the placeholder. Example:holder.js/300x200?theme=sky
random
: Use random theme. Example:holder.js/300x200?random=yes
bg
: Background color. Example:holder.js/300x200?bg=2a2025
fg
: Foreground (text) color. Example:holder.js/300x200?fg=ffffff
text
: Custom text. Example:holder.js/300x200?text=Hello
size
: Custom text size. Defaults topt
units. Example:holder.js/300x200?size=50
font
: Custom text font. Example:holder.js/300x200?font=Helvetica
align
: Custom text alignment (left, right). Example:holder.js/300x200?align=left
outline
: Draw outline and diagonals for placeholder. Example:holder.js/300x200?outline=yes
lineWrap
: Maximum line length to image width ratio. Example:holder.js/300x200?lineWrap=0.5
测试后的效果
There are 6 default themes:
sky
, vine
, lava
, gray
, industrial
, and social
. Example: holder.js/300x200?theme=social
Themes have 5 properties: fg
, bg
, size
, font
and fontweight
. The size
property specifies the minimum
font size for the theme. The fontweight
default value is bold
.
You can create a sample theme like this:
<script type="text/javascript">
Holder.addTheme("red", {
bg: "#F00",
fg: "#aaa",
size: 11,
font: "Monaco",
fontweight: "normal"
});
</script>
Holder.addTheme("red", {
bg: "#F00",
fg: "#aaa",
size: 11,
font: "Monaco",
fontweight: "normal"
});
</script>
自定义后直接使用:<img src="holder.js/300x200?theme=red" />
If you have a group of placeholders where you'd like to use particular text, you can do so by adding a text
property to the theme:
Holder.addTheme("thumbnail", { bg: "#fff", text: "Thumbnail" });
阅读全文
0 0
- holder.js的使用
- Holder的使用
- Android中holder模式的使用
- javax.xml.ws.Holder的使用方式
- Holder.js 使用说明
- 在Adapter中使用Holder的那些坑
- 在Adapter中使用Holder的那些坑
- android 低耦合度的adapter与holder案例,使用butterknife
- 我在Adapter中使用holder时踩到的坑
- Android Adapter中使用Holder 需要注意的地方
- holder.js生成占位图片
- 占位图片生成器:holder.js
- holder.js占位图片生成器
- ScrollView的Holder效果
- android MVP的holder变异
- Recycler的适配器和holder
- html图片占位符插件holder.js
- Android ListView使用Holder优化原理
- Hadoop视频教程汇总
- Python常用的内置函数
- java动态代理
- CreateRemoteThread在有些电脑上注入的Dll不执行原因
- Apache和Tomcat整合(一个Apache 不同域名处理多个不同业务) tomcat-connectors-1.2.41-src.tar.gz
- holder.js的使用
- [ Spring Boot ] Bean 单例注入
- 一分钟掌握数据库垂直拆分
- 4K分辨率单网无损延长器KE-100HK
- 结巴分词安装与使用
- Tensorflow源码编译,解决tf提示未使用SSE4.1 SSE4.2 AVX警告
- 数据库秒级平滑扩容架构方案
- 异常处理实例
- 乱码问题