![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
html
文章平均质量分 68
选择离开就别回头
这个作者很懒,什么都没留下…
展开
-
html5 检测浏览器是否支持新特性
if (Modernizr.***){ //浏览器提供***支持 }else{ //浏览器没有提供***支持 } 1.检测浏览器是否支持canvas API function supports_canvas(){ return !!document.createElement('canvas').getContext; }该函数 创建一个虚拟的元素 ;!!是双重否定来强制原创 2016-10-12 10:12:52 · 981 阅读 · 0 评论 -
HTML5 地理位置
调用地理位置APIfunction get_location(){ if(Modernizr.geolocation){ navigator.geolocation.getCurrentPosition(show_map,handle_error,{enableHighAccuracy:true,timeout:200,maximumAge:50000}); //getCurrentPo原创 2016-10-23 15:01:57 · 297 阅读 · 0 评论 -
HTML5 canvas
fillStyle 可以设置CSS颜色、一个图案或一种颜色渐变;默认纯黑。 fillRect(x,y,width,height) 绘制一个矩形,以fillStyle填充。 strokeStyle 和 fillStyle 一样。 strokeRect(x,y,width,height) 并不填充中间区域,只绘制矩形边缘。 clearRect(x,y,width,height) 清除指定矩形原创 2016-10-14 10:23:06 · 245 阅读 · 0 评论 -
HTML5 存储 & 离线web应用
cookie存储:每次HTTP请求都会发送cookie信息,会使Web变慢 每次HTTP请求的cookie信息不加密传输,不安全 cookie信息量最大不能超过4kb 检测浏览器是否支持该特性 function supports_html5_storage(){ return ('localStorage' in window) && window['localStorage原创 2016-10-26 09:57:49 · 298 阅读 · 0 评论 -
HTML5 表单
1.占位文本:在输入框为空或失去焦点时会显示,用户点击输入框或Tab键获得焦点时,占位文本消失 placeholder只支持纯文本 2.自动聚焦:不支持自动聚焦的浏览器会自动忽略autofocus属性 if(!("autofocus" in document.createElement("input"))){ document.getElemen原创 2016-10-26 10:43:08 · 236 阅读 · 0 评论 -
HTML5 <video>
HTML5 中有两种方式在网页中引入视频 有play() 和 pause()方法,currentTime属性 例子 Download video as MP4, WebM, or Ogg. //向后兼容原创 2016-10-20 15:51:08 · 397 阅读 · 0 评论