Div.querySelector('.pic').onLoad=function(){ Div.style.left=arrLeft[minIndex]+'px'; console.log(arrLeft[minIndex]+'px'); Div.style.top=arrTop[minIndex ...
分类:
其他好文 时间:
2017-07-14 13:27:25
阅读次数:
159
1.什么是js: JavaScript 是允许你在网页中实现复杂事情的一门编程语言 例子: var para = document.querySelector('p'); para.addEventListener('click', updateName); function updateName( ...
分类:
编程语言 时间:
2017-07-06 22:56:57
阅读次数:
191
总所周知,input有一属性type=‘file’,然而我们怎么读取,用户上传的信息呢? 下面是我总结的一些步骤: 1、获取file對象 var file=document.querySelector('input');2、設置change事件 file.onchange=function(){ 3 ...
分类:
其他好文 时间:
2017-07-04 21:57:58
阅读次数:
168
今天学习了H5的新标签localstorage,属于永久存储,不手动删除怎不会消失; <body> <p id="info"></p> <script > var info =document.querySelector("#info"); //处理兼容 if(typeof(localStorge) ...
分类:
其他好文 时间:
2017-06-27 01:00:40
阅读次数:
195
新增选择器 document.querySelector、document.querySelectorAll 拖拽释放(Drag and drop) API 媒体播放的 video 和 audio 本地存储 localStorage 和 sessionStorage 离线应用 manifest 桌面 ...
分类:
其他好文 时间:
2017-06-21 00:27:39
阅读次数:
157
简介 HTML5向Web API新引入了document.querySelector以及document.querySelectorAll两个方法用来更方便地从DOM选取元素,功能类似于jQuery的选择器。这使得在编写原生JavaScript代码时方便了许多。 用法 两个方法使用差不多的语法,都是 ...
分类:
Web程序 时间:
2017-06-20 00:19:53
阅读次数:
195
DOM相对应Html5的扩展 一.选择符API 1. querySelector()方法 :接收一个CSS选择符 ,返回与该模式匹配的第一个元素,若没有匹配到返回null。 其中通过Document类型调用querySelector()方法时,会在文档元素范围内查找匹配元素; 如var body = ...
分类:
Web程序 时间:
2017-06-13 22:41:51
阅读次数:
199
get请求 // document.querySelector('button').onclick=function(){ // var txt=document.querySelector('input').value; // var xhr=new XMLHttpRequest(); // xh ...
分类:
Web程序 时间:
2017-05-27 19:12:58
阅读次数:
183
1.可以给document的touchmove事件禁止掉就行了 1 2 3 document.querySelector('body').addEventListener('touchmove', function(e) { e.preventDefault(); }) 1 2 3 document ...
分类:
微信 时间:
2017-05-25 17:17:08
阅读次数:
748
querySelector/querySelectorAll item1 item2 item3 item4 item5 item6 item7 item8 item9 item10 ... ...
分类:
Web程序 时间:
2017-05-13 13:24:58
阅读次数:
161