//开始触屏$(document).on('touchstart','container',function(e){
e.preventDefault();
flag =1;})//滑动触屏$(document).on('touchmove','container',function(e){
e.preventDefault();
flag =0;})//触屏结束$(document).on('touchend','container',function(e){if(flag ===1){
e.preventDefault();$('#img-code').attr('src',$(this).data('url'));
flag =1;}})
循环判断回填ajax数据的对应值
var _len =$('button');var _grade = res.data.grade;for(var i =0;i<_len.length;i++){var _vall =$('button').eq(i).val();if(_grade == _vall){$('button').eq(i).addClass('active');return;}}
判断手机号是不是纯数字 if(!isNaN(MOBILE)){}
js随机颜色
functionrandomColor1(){var r = Math.floor(Math.random()*256);var g = Math.floor(Math.random()*256);var b = Math.floor(Math.random()*256);if(r+g+b >(256-80)*3){returnrandomColor1();}if(r <16){
r ="0"+r.toString(16);}else{
r = r.toString(16);}if(g <16){
g ="0"+g.toString(16);}else{
g = g.toString(16);}if(b <16){
b ="0"+b.toString(16);}else{
b = b.toString(16);}return"#"+r+g+b;}$(".showBookmarkcolor").last().css("background",randomColor1());
css3进度条逐一加载动效
.box{animation:animations is ease;-moz-animation:animations is ease;-webkit-animation:animations is ease;}@keyframes animations{0%{width:0px;}100%{width:400px;}}@-moz-keyframes animations{0%{width:0px;}100%{width:400px;}}@-webkit-keyframes animations{0%{width:0px;}100%{width:400px;}}