上一页 1 ··· 4 5 6 7 8 9 下一页
摘要: 先了解下插入节点时浏览器会做什么。 在浏览器中,我们一旦把节点添加到document.body(或者其他节点)中,页面就会更新并反映出这个变化,对于少量的更新,一条条循环插入也会运行很好,也是我们常用的方法。代码如下: 但是,如果当我们要向document中添加大量数据时(比如1w条),如果像上面的 阅读全文
posted @ 2017-04-06 09:39 善未易明 阅读(323) 评论(0) 推荐(0) 编辑
摘要: var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串var isOpera = userAgent.indexOf("Opera") > -1; //判断是否Opera浏览器var isIE = userAgent.indexOf("co 阅读全文
posted @ 2017-04-05 16:01 善未易明 阅读(231) 评论(0) 推荐(0) 编辑
摘要: theCanvas = document.getElementById('canvasOne');var context = theCanvas.getContext('2d');context.fillStyle = 'rgba(255, 255, 255, 0)'; 阅读全文
posted @ 2017-04-05 11:26 善未易明 阅读(15326) 评论(2) 推荐(0) 编辑
摘要: <!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]--><!--[if IE]> 所有的IE可识别 <![endif]--><!--[if IE 6]> 仅IE6可识别 <![endif]--><!--[if lt IE 6]> IE6以及IE6以下版本可识别 <![ 阅读全文
posted @ 2017-04-05 11:22 善未易明 阅读(3066) 评论(0) 推荐(0) 编辑
摘要: (function() { var lastTime = 0; var vendors = ['ms', 'moz', 'webkit', 'o']; for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) 阅读全文
posted @ 2017-03-31 14:53 善未易明 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 设置embed的透明度 wmode="transparent" <embed src="http://player.youku.com/player.php/sid/XODA2MjM4NjM2/v.swf" width="100%" height="document.body.clientWidth 阅读全文
posted @ 2017-03-29 17:20 善未易明 阅读(209) 评论(0) 推荐(0) 编辑
摘要: ,取得元素最终计算出的css 样式 var a = document.getElementById("content"); alert("style "+a.style.color); alert("css "+window.getComputedStyle(a).getPropertyValue( 阅读全文
posted @ 2017-03-24 17:38 善未易明 阅读(1447) 评论(0) 推荐(0) 编辑
摘要: 目前只适用于webkit内核 一:当为元素定义 perspective 属性时,其子元素会获得透视效果,而不是元素本身。 #div1{position: relative;height: 150px;width: 150px;margin: 50px;padding:10px;border: 1px 阅读全文
posted @ 2017-03-21 16:20 善未易明 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1、创建数组var array = new Array();var array = new Array(size);//指定数组的长度var array = new Array(item1,item2……itemN);//创建数组并赋值2、取值、赋值var item = array[index];/ 阅读全文
posted @ 2017-03-16 15:51 善未易明 阅读(182) 评论(0) 推荐(0) 编辑
摘要: var myDate = new Date(); //获取本月第一天周几 var monthFirst = new Date(myDate.getFullYear(), parseInt(myDate.getMonth()), 1).getDay(); //获取本月天数(获取后一个月的0日即前一月的 阅读全文
posted @ 2017-03-13 12:02 善未易明 阅读(5029) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 下一页