holder.js如何使用
holder.js的使用
一、总结
一句话总结:使用:holder.js后面接图片宽高
<img src="holder.js/300x200" />
1、holder.js的使用注意事项是什么?
使用:<img src="holder.js/300x200" />注意事项:300x200里面的符号是x,不是乘法号
2、holder.js后如何接类似主题这样的参数?
和url接参数的方式一致,?问号加参数(使用的时候失败了)
theme
: The theme to use for the placeholder. Example:holder.js/300x200?theme=sky
random
: Use random theme. Example:holder.js/300x200?random=yes
二、holder.js的使用
使用:<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

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:
Holder.addTheme("red", {
bg: "#F00",
fg: "#aaa",
size: 11,
font: "Monaco",
fontweight: "normal"
});
</script>
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" });
参考:holder.js的使用 - CSDN博客
https://blog.csdn.net/wang_magento/article/details/78799032
holder.js如何使用的更多相关文章
- html图片占位符插件holder.js
1.下载源码 下载链接:http://www.bootcdn.cn/holder/ 2.在HTML中引入holde.js <script src="holder-js-2.9.4\ho ...
- 你需要了解的JS框架
excanvas.js/Chart.js/cubism.js/d3.js/dc.js/dx.chartjs.js/echarts.js/flot.js 用途:构建数据统计图表,兼容多浏览器 ...
- 前端开发需要了解的JS插件
excanvas.js/Chart.js/cubism.js/d3.js/dc.js/dx.chartjs.js/echarts.js/flot.js 用途:构建数据统计图表,兼容多浏览器 jquer ...
- bootstrap1
让bootstarp3 支持ie的兼容模式: 支持浏览器的响应式布局: 是指网页既可以用在pc上,也可以用在手机上, 而且不需要修改源文件. bootstrap包括: css文件, 只需要加载: cs ...
- bootstrap--小李子demo
最近忙啊...看到各位冬鞋都在认真写博客,认真敲代码,认真工作,总觉得自己时间太少,总觉得时间不够,老了...... 进正题: 上次不知从哪里(忘了)下载了bootstrap的一些使用小demo,以后 ...
- editplus中使用emmet?
要用emmet生成html类型, 格式是: html:???, 意思是 都是html大类型, 小类型用冒号. 如:html:5, 或者全部都是! 则生成html5的类型文档. emmet是zen co ...
- bootstrap-carousel
功能:轮播插件carousel, 主要用于首页大图片的显示与左右按钮的点击滑动图片 插件:carouse.js 要点:class="carousel slide"里的data-sl ...
- 15款增强web体验的Javascript库
1. Pikaday: Standalone JavaScript Datepicker 这是一个令人耳目一新的JavaScript日期选择器 轻量轻(压缩和gzip后小于5KB) 没有依赖其它JS框 ...
- React+BootStrap+ASP.NET MVC实现自适应和组件的复用
系统展示如下 1.前端采用bootstrap3进行架构 2.后端采用asp.net mvc进行开发 开发工具vs2010 mvc4需要安装sp1的补丁. 3.js组件的封装采用react 1.新建mv ...
随机推荐
- 现在有一个函数A和函数B,请你实现B继承A
现在有一个函数A和函数B,请你实现B继承A // 方式1 function B(){} function A(){} B.prototype = new A(); // 方式2 function A( ...
- 基于Linux的智能家居的设计(2)
1 系统整体设计方案 智能家居系统的是一个实时查询家庭的温湿度.照明控制.自己主动控制的设定.集家庭娱乐.智能安防为一体,大量数据快处理.可靠的系统,因此在硬件和软件上都有非常大的要求,因此在这里进 ...
- 文件的默认权限:umask
1. 文件的默认权限 linux下当我们新建一个文件和文件夹时,该文件和文件夹的默认权限是什么? 通过umask命令来查看: $ umask 0002 $ umask -S u=rwx,g=rwx,o ...
- Launcher3实现壁纸居中
Launcher3的wallpaper显示是动态的,与Launcher预置桌面数目有关,让壁纸居中,仅仅能确保第一次开机时壁纸居中,后面用户改动桌面数目后,就无法达到了.怎样要在默认桌面数目配置时居中 ...
- Python: PS 图层混合算法汇总
本文用 Python 实现了PS 中的图层混合算法,把很多常见的图层混合算法都汇总到了一起,比起以前写的算法,就是用矩阵运算代替了很耗时的for 循环,运行效率有所提升.具体的代码如下: import ...
- 23. Angular 中用 a 标签 href 路由时在浏览器中显示异常 "%2F" 路由失败问题1
这个是angular1.6默认给hash路由上添加了!(感叹号),导致出错,修改方法如下(添加配置,去掉默认前缀感叹号): angular.module('routingDemoApp',['ng ...
- 129.C++面试一百题(1-51)
- 《读书报告 – Elasticsearch入门 》----Part II 深入搜索(2)
第十三章 全文检索 这一章开始介绍 全文检索 :怎样对全文字段(full-text fields)进行检索以找到相关度最高的文档. 全文检索最重要的两个方面是: 相关度(Relevance) 根据文档 ...
- Snort企业部署实战
Snort企业部署实战 1 背景 我们知道企业网络目前威胁来自两个位置:一个是内部,一个是外部.来自外部的威胁都能被防火墙所阻止,但内部攻击都不好防范.因为公司内部人员对系统了解很深且有合 ...
- python pdb小结
Debug功能对于developer是非常重要的,python提供了相应的模块pdb让你可以在用文本编辑器写脚本的情况下进行debug. pdb是python debugger的简称.常用的一些命令如 ...