摘要:
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 阅读全文
摘要:
样式:.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 阅读全文