随笔分类 - js ,jq
摘要:var tip_index = 0; $(document).on('mouseenter', '.layer_hover', function(){ var words = $(this).data('words'); tip_index = layer.tips(words, '.layer_hover', {time: 0}); }).on('mouseleave', '.layer_hov
阅读全文
摘要:$("#form_title").ajaxSubmit({ //页面生成的html 中含有表单提交表单方式 dataType: "json", success : function(obj){ lock_flag = false; if(obj.errno == 0){ lock_flag = fa
阅读全文
摘要:// 把多少秒 转化为 时分秒: 类似倒计时! function timestampToDate(ctime){ let returnStr = ''; // 天数位 // let day = Math.floor(ctime / 3600 / 24); // let dayStr = day.toString(); // if (dayStr.leng...
阅读全文
摘要:使用Number()函数可以解决这个问题,如下 var c = Number(a) + Number(b) 这样c得出来的解果是3,
阅读全文
摘要:获取(代码): 1 ("#img").attr('src',path);
阅读全文
摘要:$(document).on('click','#submit_title_btn',function(){ var title = $("#title").val(); if (!title) { // 添加 dealText('#title','请输入题目内容'); ...
阅读全文
摘要:delivery_show(); $('.delivery_btn').on('click',function(){ delivery_show(); }); function delivery_show() { var delivery_type_val = $("input[n...
阅读全文
摘要:$(document).on('click','#getcode',function(){ var tel = ('#getcode'); var _this_html = _this.html(); const numreg = /^\d/; const reg = /^1[3|4|5|6|7...
阅读全文
摘要:$(".good_info").on('click',function () { var id = $(this).data('id'); var string = 'http://qr.liantu.com/api.php?text=https://hostname/wx.php/Good/det
阅读全文
摘要:/(^[1-9]\d*(\.\d{1,2})?)/ var reg = /(^[1-9]\d*(\.\d{1,2})?)/; if (!price){ alert("请输入订单价格"); return; } if (!reg
阅读全文
摘要:function timestampToTime(timestamp) { var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 Y = date.getFullYear() + '-'; M = (date.g
阅读全文
摘要:var A = {a:1,b:2,c:3,d:"hello world"}; for(var k in A) { console.log(k,A[k]); var h = new EJS({element:'ejs_render_id'}).render(render); } return;
阅读全文
摘要:默认tips层几秒后自动关闭。请问如何实现类似页面层时,点击页面层外部遮罩手动关闭的效果?下面我加了time: 20000 时间控制在20秒后自动关闭,但是显得比较呆板,不如用户手动点击关闭来的灵活。
阅读全文
摘要:if(_each_this_type_name == 'post_num'){ var patrn = /^[a-zA-Z0-9]{3,12}$/; if(!patrn.test(_each_this_val)){ alert(_each_this_name + "没填写或格式错误"); direct_btn = false; _each_t...
阅读全文
摘要:$("input[type='text']").each(function(){ if($(this).data('parent_id')){ var _each_this_parent_id = parseInt($(this).data('parent_id')); if(_each_this_parent_id != ...
阅读全文
摘要:var radio_checked_array = []; $("input[type='radio']").each(function(){ if($(this).attr('checked') == 'checked'){ var _each_this_val = parseInt($(this).val()); ...
阅读全文
摘要:("#form_step_1_ejs_append_id input[name='1']:checked").val();//这个判断语句,
阅读全文
摘要:$('.main_div').each(function(){ product_id = parseInt((this).data('num')); productList_array.productList.push({"productId":pro...
阅读全文
摘要:<div class="every_content last_place" data-order_id="2"> <p style="line-height: 40px;">已支付</p> //line-height 是数据处理之后的代码............ <p style="line-hei
阅读全文