var wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 0, mobile: true, live: true }); wow.init(); var jsondata = []; $(function() { $("#myselect").change(function() { var id = $("#myselect").find("option:selected").attr('data-id'); $.ajax({ url: '/api/index/ppcx', type: 'post', processdata: true, data: { id: id }, datatype: 'json', success: function(ret) { $('#myselect2').html(); var html = ""; for (var i = 0; i < ret.data.length; i++) { html = html + ""; } console.log(html); $('#myselect2').html(html); } }); }) resize(); var d = new date() var weekday = new array(); weekday[0] = "星期日"; weekday[1] = "星期一"; weekday[2] = "星期二"; weekday[3] = "星期三"; weekday[4] = "星期四"; weekday[5] = "星期五"; weekday[6] = "星期六"; var year = d.getfullyear(); var motnh = d.getmonth() + 1; var day = d.getdate(); var str = year + '年' + motnh + '月' + day + '日' + "      " + weekday[d.getday()]; $('#time').html(str); var win_width = $(window).width(); var win_height = $(window).height(); var btn2 = true; var aj = 0; if (navigator.appname == "microsoft internet explorer" && parseint(navigator.appversion.split(";")[1].replace(/[ ]/g, "").replace("msie", "")) <= 12) { alert("您的浏览器版本过低,请下载microsoft edge及以上版本"); $("body").html(); } else { settimeout(function() { $(".loading").fadeout(); }, 1800); settimeout(function() { var cp_swiper = new swiper(".cp-swiper", { slidesperview: 3, spacebetween: 10, slidespergroup: 1, loop: true, autoplay: true, navigation: { nextel: ".incp-swiper-button-next", prevel: ".incp-swiper-button-prev", }, pagination: { el: '.swiper-pagination-index-cp', clickable: true, }, centeredslides: true, breakpoints: { 1024: { slidesperview: 2, slidespergroup: 2, spacebetween: 10, centeredslides: false, }, }, }); var news_swiper = new swiper(".news-swiper", { slidesperview: 3, spacebetween: 30, loop: true, autoplay: true, navigation: { nextel: ".news-swiper-button-next", prevel: ".news-swiper-button-prev", }, centeredslides: true, breakpoints: { 640: { slidesperview: 1, spacebetween: 0, }, 768: { slidesperview: 1, spacebetween: 0, }, 1024: { slidesperview: 1, spacebetween: 0, }, }, }); $('.incpdl dd').hide(); $('.incpdl dd').eq(0).show(); }, 100); } $('.ly_btn').click(function() { var phone = $('#liuyanmobile').val(); if (!phone || !/^[1][3,4,5,7,8][0-9]{9}$/.test(phone)) { layer.msg('请输入正确的手机号码'); return false; } $.ajax({ url: '/addons/cms/api/diyform', type: 'post', processdata: true, data: $("form").serialize(), datatype: 'json', success: function(ret) { if (ret.code == 0) { layer.msg(ret.msg); } else { layer.msg(ret.msg); settimeout(function() { window.location.reload(); }, 1000); } } }); }); $('.ind-news-ul').owlcarousel({ items: 1, itemsdesktop: [1199, 1], itemsdesktopsmall: [980, 1], itemstablet: [768, 1], itemsmobile: [479, 1], loop: false, autoplay: false, autoheight: false, pagination: true, navigation: true, navigationtext: [" ", " "] }); $(".ind-news-btn").on("touch", function() { var _ind = $(this).index(); $(this).addclass("active").siblings().removeclass("active"); $(".ind-news-sec").eq(_ind).show().siblings().hide(); }); $(".ind-news-btn").hover(function() { var _ind = $(this).index(); $(this).addclass("active").siblings().removeclass("active"); $(".ind-news-sec").eq(_ind).show().siblings().hide(); }); var height11 = $('.xsfuwu_div4 ul .li2 .image').outerheight(); var width11 = $('.xsfuwu_div4 ul .li2 .image').outerwidth(); $('.xsfuwu_div4 ul .li .image').height(height11); $('.xsfuwu_div4 ul .li .image').width(width11); $(window).on('resize', function() { var win_width1 = $(window).width(); if (win_width1 > 1024) { var height1 = $('.xsfuwu_div4 ul .li2 .image').outerheight(); var width1 = $('.xsfuwu_div4 ul .li2 .image').outerwidth(); $('.xsfuwu_div4 ul .li .image').height(height1); $('.xsfuwu_div4 ul .li .image').width(width1); } }); $(".d-dgd__line1 .d-dgd__line1__tab").click(function() { $(".d-dgd__line1 .d-dgd__line1__tab").removeclass('selected-tab'); $(this).addclass('selected-tab'); $('.d-ggdh__content').hide(); $('#dline' + $(this).index()).show(); }); $(".video_list1 li").click(function() { var video = $(this).attr('data-video'); if (video != '') { $('.my-video-play1').show(); $('.body-mask-video1').show(); $('#video_play').attr('src', video); } }); $(".video_list2 li").click(function() { var video = $(this).attr('data-video'); if (video != '') { $('.my-video-play2').show(); $('.body-mask-video').show(); $('#video_play2').attr('src', video); } }); $(".video_list3 a").click(function() { var video = $(this).attr('data-video'); if (video != '') { $('.my-video-play').show(); $('.body-mask-video').show(); $('#video_play').attr('src', video); } }); $(".my-video-play img").click(function() { $('#video_play').attr('src', ''); $('#video_play2').attr('src', ''); $('.my-video-play2').hide(); $('.my-video-play1').hide(); $('.body-mask-video').hide(); }); $(".serch .s1").click(function() { var dis = $(".i_ss_c").css("display"); if (dis == "none") { $(".i_ss_c").show(); } else { $(".i_ss_c").hide(); } }) // $(".a_rlzydiv_c dd").eq(0).find(".div").addclass("activerc"); // $(".a_rlzydiv_c dd").eq(0).find(".div1").slidedown(500); $(".a_rlzydiv_c dd .div").click(function() { $(".a_rlzydiv_c dd .div").removeclass("activerc"); $(".a_rlzydiv_c dd .div1").slideup(500); var dis = $(this).parent().find(".div1").css("display"); var dlshow = $(this).parent().find(".div1").length; if (dlshow > 0 && dis == "none") { $(this).parent().find(".div").addclass("activerc"); $(this).parent().find(".div1").slidedown(500); } }); $(".fofix .close").click(function() { $('.fofix').fadeout(500); }); $(".fanhui").click(function() { $('html,body').animate({ 'scrolltop': 0 }, 500); //杩斿洖椤堕儴鍔ㄧ敾 鏁板€艰秺灏忔椂闂磋秺鐭� }); $('.imglist li').magnificpopup({ delegate: 'a', // the selector for gallery item type: 'image', gallery: { enabled: true } }); $(".a_zxlmenu_c li").click(function() { var dis = $(this).parent().find(".a_zxlmenu_c1").css("display"); if (dis == "none") { $(this).parent().find(".a_zxlmenu_c1").stop(false, true).slidedown(500); } else { $(this).parent().find(".a_zxlmenu_c1").slideup(500); } }); $(".a_zxlmenu .a_zxlmenu_t").click(function() { var dis = $(this).parent().find(".a_zxlmenu_c").css("display"); if (dis == "none") { $(this).parent().find(".a_zxlmenu_c").stop(false, true).slidedown(500); } else { $(this).parent().find(".a_zxlmenu_c").slideup(500); } }); $(".renli li .n_c1").click(function() { var dis = $(this).parent().find(".n_c2").css("display"); if (dis == "none") { $(this).parent().addclass('active'); $(this).parent().find(".n_c2").stop(false, true).slidedown(500); } else { $(this).parent().removeclass('active'); $(this).parent().find(".n_c2").slideup(500); } }); $('.zhangcheng li .text1').click(function() { var dis = $(this).parent().find(".text").css("display"); if (dis == "none") { $(this).parent().find(".text").stop(false, true).slidedown(500); $(this).parent().addclass('active'); } else { $(this).parent().find(".text").slideup(500); $(this).parent().removeclass('active'); } }); $('.nemnu li').click(function() { var dis = $(this).find("dl").css("display"); if (dis == "none") { $(this).find("dl").stop(false, true).slidedown(500); } else { $(this).find("dl").slideup(500); } }); $('.nemnu li').each(function() { if ($(this).hasclass('active')) { $(this).find('dl').show(); } }); var btn = true; $(".nav_but_box").click(function() { $(this).parent().toggleclass("phone_nav_one") $("body").toggleclass('hided'); if (btn) { $(".phone_nav .nav_but").css("background", "none"); btn = false; } else { $(".phone_nav .nav_but").css("background", "#2e366c"); btn = true; } }) //手机导航 $(".nav_main b").click(function() { $(this).parent().toggleclass("b_one") .siblings().removeclass("b_one"); }) $('.yingping').click(function() { $('#zhiwei').val($(this).attr('data-name')); $('#yp_ti').html($(this).attr('data-name')); var win_width3 = $(window).width(); if (win_width3 > 1200) { layer.open({ type: 1, area: ['60%'], content: $('#tishi').html() //这里content是一个普通的string }); } else { layer.open({ type: 1, content: $('#tishi').html() //这里content是一个普通的string }); } }) $(".remenu li").click(function() { var datatype = $(this).attr('data-type'); $(".remenu li").removeclass('active'); $(this).addclass('active'); $('#regtype').val(datatype); }); function resize() { var bgwidth = document.documentelement.clientwidth; var bgheight = document.documentelement.clientheight; var navh = $(".headerbox2").height(); var bannerh = bgheight - navh; $(".yc_box1").css({ "height": bgheight + "px" }); if (bgwidth > 992) { $("#banner").css({ "height": bannerh + "px" }); } else { /*$("#banner").css({"height":"auto !important"});*/ $("#banner").css({ "height": "auto" }); } } var bodyhight = $('body').height() if ((bodyhight / 2) < win_height) { $(".fixliuyan").addclass('liuyanactive'); } $(window).scroll(function() { if ($(window).scrolltop() > 80) { $(".inheder").addclass('nheder'); } else { $(".inheder").removeclass('nheder'); } }); $("#video_open").click(function() { $(".video_div").stop(false, true).animate({ "top": "0px" }, 500); }); $(".video_div_closebtv").click(function() { $(".video_div").stop(false, true).animate({ "top": "-100%" }, 500); //$("#video_yscj").attr("src",""); $(".video_div_center").html(' ') }); $(".in_cpmenu li").hover(function() { $('.incpdl dd').hide(); $('.incpdl dd').eq($(this).index()).show(); $(".in_cpmenu li").removeclass(); $(this).addclass('active'); }, function() { }); var indexswiper = new swiper('.index-swiper', { speed: 2000, // effect: 'fade', loop: true, autoplay: { delay: 6000, stoponlastslide: false, disableoninteraction: false, }, pagination: { el: '.swiper-pagination-index-banner', clickable: true, }, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, }); var kjswiper2 = new swiper(".kj_wiper2", { spacebetween: 20, slidesperview: 4, freemode: true, watchslidesprogress: true, breakpoints: { 320: { slidesperview: 2, spacebetween: 10, }, 768: { slidesperview: 2, spacebetween: 10, }, 1024: { slidesperview: 2, spacebetween: 10, }, 1200: { slidesperview: 4, spacebetween: 20, }, }, on: { slidechangetransitionstart: function() { kjswiper1.slideto(this.activeindex, 1000, false); //切换到第一个slide,速度为1秒 }, }, }); var kjswiper1 = new swiper(".kj_wiper1", { spacebetween: 0, thumbs: { swiper: kjswiper2, }, autoplay: { delay: 5500, disableoninteraction: false, }, on: { slidechangetransitionstart: function() { kjswiper2.slideto(this.activeindex, 1000, false); //切换到第一个slide,速度为1秒 }, }, }); $('.cpullist li').magnificpopup({ delegate: 'a', // the selector for gallery item type: 'image', gallery: { enabled: true } }); $(".fanhui").click(function() { $('html,body').animate({ 'scrolltop': 0 }, 500); //杩斿洖椤堕儴鍔ㄧ敾 鏁板€艰秺灏忔椂闂磋秺鐭� }); $(".jishu_ul2 li").click(function() { $('.jishu_ul2 li').removeclass('active'); $(this).addclass('active'); $('.jishu_ul1 li').hide(); $('.jishu_ul1 li').eq($(this).index()).show(); }); $('#yc').click(function() { $('.duibi').slideup(500); }); if ($('.scrollarea1').length) { $('.scrollarea1').tinyscrollbar({ axis: 'y', thumbsize: 80, wheellock: false }); } if ($('.scrollarea2').length) { $('.scrollarea2').tinyscrollbar({ axis: 'x', wheellock: false }); } if ($('.scrollarea3').length) { $('.scrollarea3').tinyscrollbar({ axis: 'x', wheellock: false }); } });