摘要: Array.prototype.max=function(){ //最大值returnMath.max.apply({},this)}Array.prototype.min=function(){ //最小值returnMath.min.apply({},this)}[1,2,3].max()//=>3[1,2,3].min()//=>1Array.max=function(array){returnMath.max.apply(Math,array);}Array.min=function(array){returnMath.min.apply(Math,array);}vart 阅读全文
posted @ 2011-11-15 14:53 ゞ追忆o0ゞ 阅读(13733) 评论(1) 推荐(2) 编辑
摘要: 样式:.red{ border:1px solid #d00; background:#ffe9e8; color:#d00;}functionshake(ele,cls,times){ vari=0,t=false,o=ele.attr("class")+"",c="",times=times||2;if(t)return; t=setInterval(function(){ i++; c=i%2?o+cls:o; ele.attr("class",c);if(i==2*times){ clearInterval 阅读全文
posted @ 2011-11-15 10:09 ゞ追忆o0ゞ 阅读(4098) 评论(1) 推荐(0) 编辑