
js
Anticlimax丶
这个作者很懒,什么都没留下…
展开
-
js function中返回function 闭包
window.onload = function(){ debugger a(); b(); function a(){ for(var i =1;i<4;i++){ var p = createElement("a", { href: "javascript:void(0)" }); p.appendChild(createElement("p", null, null, i));原创 2017-11-06 17:02:12 · 1676 阅读 · 0 评论 -
input file选择图片后显示(FileReader)
html: js: function show(f) { var str = ""; for (var i = 0; i < f.length; i++) { var reader = new FileReader(); reader.readAsDataURL(f[i]);原创 2018-01-17 13:14:52 · 5129 阅读 · 0 评论 -
html loading 页面加载中(百分比)
$(function(){})是dom加载完毕后执行,window.onload是所有资源(图片和js外部资源)加载完毕后执行。 var Inter1 = null; //二选一 $(function () { //DOM加载完毕后执行 Inter1 = setInterval('addBar()', 100); }) document.addEventLi...原创 2018-12-27 19:09:06 · 9039 阅读 · 0 评论 -
Div通过html2canvas.js生成一张图片(可跨域)
第一次开发图片合成时的解决方案: html <div id="capture" style="padding: 10px; background: #f5da55"> <h4 style="color: #000; ">Hello world!</h4> </div> js: html2canvas(document.queryS...原创 2019-01-17 19:11:58 · 2100 阅读 · 0 评论