上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 在js中进行以元为单位进行金额计算时 使用parseFloat会产生精度问题 var price = 10.99; var quantity = 7; var needPay = parseFloat(price * quantity); needPay的正确结果应该是76.93元... 阅读全文
posted @ 2013-11-19 13:07 CatherineGao 阅读(5593) 评论(0) 推荐(0) 编辑
摘要: http://ernestdelgado.com/public-tests/gifoncanvas/ Animated Gif on Canvas 阅读全文
posted @ 2013-11-06 14:47 CatherineGao 阅读(1591) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.iamued.com/qianduan/1645.html今天看到这篇文章,学到了不少东西 特此发出来 和大家分享JavaScript的setTimeout与setInterval是两个很容易欺骗别人感情的方法,因为我们开始常常以为调用了就会按既定的方式执行, 我想不少人都深有同感, 例如setTimeout( function(){ alert(’你好!’); } , 0);setInterval( callbackFunction , 100);认为setTimeout中的问候方法会立即被执行,因为这并不是凭空而说,而是JavaScript API文档明确定义第 阅读全文
posted @ 2013-11-06 12:05 CatherineGao 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-10-09 19:06 CatherineGao 阅读(109) 评论(0) 推荐(0) 编辑
摘要: function orientationChange(){switch(window.orientation) {case 0: // Portraitcase 180: // Upside-down Portrait// Javascript to setup Portrait viewbreak;case -90: // Landscape: turned 90 degrees counter-clockwisecase 90: // Landscape: turned 90 degrees clockwise// Javascript to steup Landscape viewbre 阅读全文
posted @ 2013-09-29 12:59 CatherineGao 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.alloyteam.com/2012/07/convert-picture-to-sketch-by-canvas/腾讯的alloy team写的一个素描效果,挺不错的。<img title="sketch" src="http://www.alloyteam.com/wp-content/uploads/auto_save_image/2012/07/0208516qY.png" alt="" width="534" height="398&qu 阅读全文
posted @ 2013-09-24 13:37 CatherineGao 阅读(1380) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.2cto.com/kf/201209/156169.html前端的代码:[javascript]function drawArrow(angle){ //Init canvas var canvas = $('#cv_Arrow')[0]; var context = canvas.getContext('2d'); var width = canvas.width; var height = canvas.height; context.clearRect(0, 0, width, height); //Rotate var dis 阅读全文
posted @ 2013-09-24 13:10 CatherineGao 阅读(3990) 评论(0) 推荐(0) 编辑
摘要: 原文:http://www.oschina.net/code/snippet_12_3073function addDNDListeners(){ var container = document.getElementById("container"); var fileList = document.getElementById("fileList"); container.addEventListener("dragenter", function(event){ fileList.innerHTML =''; e 阅读全文
posted @ 2013-09-24 12:59 CatherineGao 阅读(565) 评论(0) 推荐(0) 编辑
摘要: 例:1-20的随机数组,找丢失的某几个数function find(arr,count){ var str= arr.toString(); var newarr=[]; for(var i=1;i<=count;i++){ var reg=new RegExp("^"+i+",|,"+i+",|,"+i+"$","g"); if(reg.test(str)) continue; newarr.push(i); } return newarr;}var arr=[11,2,4,7,8,3, 阅读全文
posted @ 2013-09-05 18:08 CatherineGao 阅读(218) 评论(0) 推荐(0) 编辑
摘要: js打开新页面.关闭当前页.关闭父页面 2010-04-29 14:04:13|分类: 页面与JavaScript |标签: |字号大中小订阅 //关闭当前页面,并且打开新页面,(不提示) function c... 阅读全文
posted @ 2013-08-28 11:28 CatherineGao 阅读(8609) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页