function check_search(){ var keywords=$("#global_search").val(); if(!keywords){ return false; } } $(document).ready(function($){ //判断产品详情型号 var xtsize = $(".xtProduct .xtProduct_title .xtProduct_title_list").length if( xtsize == 6){ $(".xtProduct").addClass("xtProduct_content6"); } if( xtsize == 7){ $(".xtProduct").addClass("xtProduct_content7"); } if( xtsize == 8){ $(".xtProduct").addClass("xtProduct_content8"); } if( xtsize == 9){ $(".xtProduct").addClass("xtProduct_content9"); } if( xtsize == 11){ $(".xtProduct").addClass("xtProduct_content11"); } if( xtsize == 12){ $(".xtProduct").addClass("xtProduct_content12"); } $(".MyOrder .MyOrder_content .MyOrder_content_bottom .content_bottom_txt .bottom_txt_list").each(function() { var h_1 = $(this).find(".list_body_product").height(); $(this).find(".body_product_li").height(h_1); }); //视频播放 $(".click_video").click(function() { $(".content_list_video").show(); $(".content_list_video").show(); $(".content_list_video .list_video_content video").trigger('play'); }); $(".list_video_bg").click(function(){ $(".content_list_video").hide(); $(".content_list_video .list_video_content video").trigger('pause'); }); $(".fa-close").click(function(){ $(".content_list_video").hide(); $(".content_list_video .list_video_content video").trigger('pause'); }); $(".MyOrder .MyOrder_content .MyOrder_content_bottom .content_bottom_txt .bottom_txt_list").each(function() { var h_1 = $(this).find(".list_body_product").height(); $(this).find(".body_product_li").height(h_1); }); //视频播放 $(".click_video").click(function() { $(".content_list_video").show(); $(".content_list_video").show(); $(".content_list_video .list_video_content video").trigger('play'); }); $(".list_video_bg").click(function(){ $(".content_list_video").hide(); $(".content_list_video .list_video_content video").trigger('pause'); }); $(".fa-close").click(function(){ $(".content_list_video").hide(); $(".content_list_video .list_video_content video").trigger('pause'); }); //销售合同 $(".agree").click(function(){ $("#fwtk").show(); }) $(".fa-close").click(function(){ $("#fwtk").hide(); }) var h = $(".UserCenter .UserCenter_right").height(); $(".UserCenter .UserCenter_left").height(h + 40); //地址弹窗 $(".new_address").click(function(){ $(".NewAddress").fadeIn(); }) $(".address_edit").click(function(){ $(".NewAddress").fadeIn(); $(".NewAddress_bg").show(); }) $(".NewAddress_close").click(function(){ $(".NewAddress").fadeOut(); $(".NewAddress_bg").hide(); }) //发票弹窗 $(".InvoiceSetting").click(function(){ }) $(".new_Invoice").click(function(){ $(".NewInvoice").fadeIn(); }) $(".Invoice_edit").click(function(){ $(".NewInvoice").fadeIn(); $(".NewAddress_bg").show(); }) $(".SelectInvoice_close").click(function(){ $(".SelectInvoice").fadeOut(); $(".bg").hide(); }) $(".NewInvoice_close,.NewAddress_submit_cancel").click(function(){ $(".NewInvoice").fadeOut(); $(".NewAddress_bg").hide(); }) //商品增减 $(".bottom_content_list").each(function(){ var t = $(this).find(".quantity"); $(this).find(".add").click(function(){ t.val(parseInt(t.val())+1); $(this).prevAll(".min").removeAttr("disabled"); $(this).prevAll(".min").css("cursor","pointer"); $(this).prevAll(".min").css("color","#333"); //当按加1时,解除$("#min")不可读状态 }) $(this).find(".min").click(function(){ if (parseInt(t.val())>1) { //判断数量值大于1时才可以减少 t.val(parseInt(t.val())-1) }else{ $(this).attr("disabled","disabled"); $(this).css("cursor","not-allowed"); $(this).css("color","#cccccc"); //当$("#min")为1时,$("#min")不可读状态 } if( t.val() == 1 ){ $(this).attr("disabled","disabled"); $(this).css("cursor","not-allowed"); $(this).css("color","#cccccc"); } }) if( t.val() == 1 ){ $(this).find(".min").attr("disabled","disabled"); $(this).find(".min").css("cursor","not-allowed"); $(this).find(".min").css("color","#cccccc"); } }); //商品增减 $(".xtProduct_contentList").each(function(){ var t = $(this).find(".quantity"); $(this).find(".add").click(function(){ t.val(parseInt(t.val())+1); $(this).nextAll(".min").removeAttr("disabled"); $(this).nextAll(".min").css("cursor","pointer"); $(this).nextAll(".min").css("color","#333"); //当按加1时,解除$("#min")不可读状态 }) $(this).find(".min").click(function(){ if (parseInt(t.val())>1) { //判断数量值大于1时才可以减少 t.val(parseInt(t.val())-1) }else{ $(this).attr("disabled","disabled"); $(this).css("cursor","not-allowed"); $(this).css("color","#cccccc"); //当$("#min")为1时,$("#min")不可读状态 } if( t.val() == 1 ){ $(this).attr("disabled","disabled"); $(this).css("cursor","not-allowed"); $(this).css("color","#cccccc"); } }) if( t.val() == 1 ){ $(this).find(".min").attr("disabled","disabled"); $(this).find(".min").css("cursor","not-allowed"); $(this).find(".min").css("color","#cccccc"); } }); //获取收件地址的个数 function address_s(){ var size = $(".AddressDetails .AddressDetails_content .AddressDetails_content_list").length $(".address_size").text(size); } address_s(); //手机端禁止滑动屏幕 function touchmove(){//自定义函数 $("body").on("touchmove",function(event){ event.preventDefault; }, false) } function touchmove2(){//自定义函数 $("body").off("touchmove"); } var flag=true; $('.cd-nav-trigger').on('click', function () { if(flag){ flag=false; touchmove(); } else{ flag=true; touchmove2(); } }); //手机端导航 function responsive() { if($(window).width() <= 1200){ console.log('mobile navigation'); $('#mo_nav').infinitypush(); $('body').removeClass('desktop'); } else { console.log('desktop navigation'); $('#mo_nav').infinitypush({ destroy:true }); $('body').addClass('desktop'); } } function windowResize(){ $(window).resize(function(){ responsive(); }); } responsive(); windowResize(); var isLateralNavAnimating = false; //open/close lateral navigation $('.cd-nav-trigger').on('click', function(event){ event.preventDefault(); if( !isLateralNavAnimating ) { if($(this).parents('.csstransitions').length > 0 ) isLateralNavAnimating = true; $('body').toggleClass('navigation-is-open'); $('.ma-infinitypush-wrapper').toggleClass('on'); $('.cd-navigation-wrapper').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){ //animation is over isLateralNavAnimating = false; }); } }); });