html2canvas
===========
[Homepage](https://html2canvas.hertzen.com) | [Downloads](https://github.com/niklasvh/html2canvas/releases) | [Questions](https://github.com/niklasvh/html2canvas/discussions/categories/q-a)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/niklasvh/html2canvas?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
![CI](https://github.com/niklasvh/html2canvas/workflows/CI/badge.svg?branch=master)
[![NPM Downloads](https://img.shields.io/npm/dm/html2canvas.svg)](https://www.npmjs.org/package/html2canvas)
[![NPM Version](https://img.shields.io/npm/v/html2canvas.svg)](https://www.npmjs.org/package/html2canvas)
#### JavaScript HTML renderer ####
The script allows you to take "screenshots" of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.
### How does it work? ###
The script renders the current page as a canvas image, by reading the DOM and the different styles applied to the elements.
It does **not require any rendering from the server**, as the whole image is created on the **client's browser**. However, as it is heavily dependent on the browser, this library is *not suitable* to be used in nodejs.
It doesn't magically circumvent any browser content policy restrictions either, so rendering cross-origin content will require a [proxy](https://github.com/niklasvh/html2canvas/wiki/Proxies) to get the content to the [same origin](http://en.wikipedia.org/wiki/Same_origin_policy).
The script is still in a **very experimental state**, so I don't recommend using it in a production environment nor start building applications with it yet, as there will be still major changes made.
### Browser compatibility ###
The library should work fine on the following browsers (with `Promise` polyfill):
* Firefox 3.5+
* Google Chrome
* Opera 12+
* IE9+
* Safari 6+
As each CSS property needs to be manually built to be supported, there are a number of properties that are not yet supported.
### Usage ###
The html2canvas library utilizes `Promise`s and expects them to be available in the global context. If you wish to
support [older browsers](http://caniuse.com/#search=promise) that do not natively support `Promise`s, please include a polyfill such as
[es6-promise](https://github.com/jakearchibald/es6-promise) before including `html2canvas`.
To render an `element` with html2canvas, simply call:
` html2canvas(element[, options]);`
The function returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) containing the `<canvas>` element. Simply add a promise fulfillment handler to the promise using `then`:
html2canvas(document.body).then(function(canvas) {
document.body.appendChild(canvas);
});
### Building ###
You can download ready builds [here](https://github.com/niklasvh/html2canvas/releases).
Clone git repository:
$ git clone git://github.com/niklasvh/html2canvas.git
Install dependencies:
$ npm install
Build browser bundle
$ npm run build
### Examples ###
For more information and examples, please visit the [homepage](https://html2canvas.hertzen.com) or try the [test console](https://html2canvas.hertzen.com/tests/).
### Contributing ###
If you wish to contribute to the project, please send the pull requests to the develop branch. Before submitting any changes, try and test that the changes work with all the support browsers. If some CSS property isn't supported or is incomplete, please create appropriate tests for it as well before submitting any code changes.
没有合适的资源?快使用搜索试试~ 我知道了~
css+js+html(画眨眼睛,手拿玫瑰心动的蜡笔小新)
共475个文件
js:151个
map:149个
ts:143个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 5 下载量 103 浏览量
2022-11-04
10:26:34
上传
评论
收藏 1.2MB RAR 举报
温馨提示
css+js+html(画眨眼睛,手拿玫瑰心动的蜡笔小新) css+js+html(画眨眼睛,手拿玫瑰心动的蜡笔小新) css+js+html(画眨眼睛,手拿玫瑰心动的蜡笔小新) css+js+html(画眨眼睛,手拿玫瑰心动的蜡笔小新)
资源推荐
资源详情
资源评论
收起资源包目录
css+js+html(画眨眼睛,手拿玫瑰心动的蜡笔小新) (475个子文件)
index.css 9KB
index.html 2KB
jietu.html 2KB
meiguihua.html 1KB
paomadeng.html 960B
html2canvas.js 431KB
html2canvas.js 431KB
html2canvas.esm.js 401KB
html2canvas.min.js 194KB
css-line-break.umd.js 83KB
css-line-break.es5.js 80KB
canvas-renderer.js 56KB
utrie.umd.js 52KB
linebreak-trie.js 52KB
utrie.es5.js 47KB
text-segmentation.umd.js 42KB
text-segmentation.es5.js 40KB
TrieBuilder.js 39KB
grapheme-break-trie.js 26KB
document-cloner.js 25KB
tokenizer.js 24KB
LineBreak.js 20KB
cache-storage.js 19KB
counter.js 15KB
index.js 15KB
bound-curves.js 14KB
image-tests.js 12KB
background.js 11KB
index.js 11KB
cache-storage.js 10KB
color.js 9KB
stacking-context.js 8KB
node-parser.js 8KB
features.js 8KB
gradient.js 7KB
Trie.js 7KB
index.js 7KB
GraphemeBreak.js 7KB
foreignobject-renderer.js 6KB
color-tests.js 6KB
parser.js 6KB
text.js 5KB
border.js 5KB
list-style-type.js 4KB
input-element-container.js 4KB
radial-gradient.js 4KB
text-shadow.js 4KB
radial-gradient.js 4KB
Util.js 4KB
-prefix-radial-gradient.js 4KB
logger.js 3KB
paint-order.js 3KB
iframe-element-container.js 3KB
display.js 3KB
angle.js 3KB
image.js 3KB
base64-arraybuffer.umd.js 3KB
-webkit-gradient.js 2KB
background-tests.js 2KB
font-metrics.js 2KB
Util.js 2KB
bounds.js 2KB
base64-arraybuffer.es5.js 2KB
length-percentage.js 2KB
box-shadow.js 2KB
index.js 2KB
svg-element-container.js 2KB
transform.js 2KB
bezier-curve.js 2KB
text-shadow.js 2KB
effects.js 2KB
tokernizer-tests.js 2KB
image-element-container.js 2KB
select-element-container.js 1KB
canvas-element-container.js 1KB
ol-element-container.js 1KB
element-container.js 1KB
textarea-element-container.js 1KB
li-element-container.js 1KB
box-sizing.js 1KB
font-family.js 1KB
quotes.js 1KB
-prefix-linear-gradient.js 1KB
font-family.js 1KB
paint-order.js 1KB
counter-increment.js 1KB
background-repeat.js 1KB
logger.js 1KB
linear-gradient.js 1KB
text-container.js 1KB
border-style.js 998B
background-size.js 985B
transform-tests.js 981B
text-decoration-line.js 971B
logger.js 940B
counter-reset.js 929B
border-radius.js 916B
path.js 888B
overflow.js 880B
line-height.js 876B
共 475 条
- 1
- 2
- 3
- 4
- 5
资源评论
- 邢宇航.2022-12-14资源很赞,希望多一些这类资源。
- 迷途的小灯匠2024-04-01超级好的资源,很值得参考学习,对我启发很大,支持!
- 随Asy飞2023-10-29资源使用价值高,内容详实,给了我很多新想法,感谢大佬分享~
- m0_752351642022-11-22资源有很好的参考价值,总算找到了自己需要的资源啦。
- m0_749767662023-04-06资源中能够借鉴的内容很多,值得学习的地方也很多,大家一起进步!
飞飞翼
- 粉丝: 4461
- 资源: 78
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功