$(function () { wowInt(); findTel(); phoneTargetSelf(); $(window).resize(); nav(); search(); share(); select02(); recruitslider(); if($(window).width()>767){ // ScollText(""); ScollText(".index_scoll"); ScollText(".craft_text dd p"); ScollText(".cultural_text .cultural_p"); } if($(window).width()>1024){ culture_animate(); ScollText(".cultural_text .cultural_p"); } if($(window).width()>1080){ ScollText(".pro_dedit"); } $(".sitemap dd em").parent("p").addClass("cur"); $(document).on("click",".header_fast dt",function(e){ e.preventDefault(); e.stopPropagation(); $(this).siblings().slideToggle(); $(".header_search").removeClass("cur"); $("body").removeClass("navbody"); }) $(document).click(function(){ $(".header_fast dd").slideUp(); }) if($(".allusion_list li").length>4){ $(".allusion_list .painting_more").show(); $(document).on("click",".allusion_list .painting_more",function(){ $(".allusion_list").addClass("cur"); $(this).hide(); imgratio(); setTimeout(function () { imgratio(); }, 200); wowInt(); }) } }) function search(){ $(document).on("click",".header_search span",function(e){ e.preventDefault(); e.stopPropagation(); $(this).parent(".header_search").toggleClass("cur"); $(".header_fast dd").slideUp(); $("body").removeClass("navbody"); }) $(document).on("click",".headersearch_box",function(e){ e.preventDefault(); e.stopPropagation(); }) $(document).click(function(){ $(".header_search").removeClass("cur") }) } function nav(){ $(".menu_button").click(function(){ $(this).toggleClass("visible_nav"); $("body").toggleClass("navbody"); $(".header_search").removeClass("cur"); $(".header_fast dd").slideUp(); }) $(window).scroll(function () { if ($(this).scrollTop() > 0) { $('body').addClass('scrollHeader'); } else { $('body').removeClass('scrollHeader'); } }); if($(window).width()>1230){ $(".nav").hover(function(){ $(".nav_bg,.nav_list").stop().slideDown(); },function(){ $(".nav_bg,.nav_list").stop().slideUp(); }) $(".nav li").hover(function(){ $(this).addClass("cur").siblings().removeClass("cur"); },function(){ $(this).removeClass("cur"); }) }else{ $(".nav .nav_list .nav_p p").click(function(){ $("body").removeClass("navbody"); }) $(document).on("click",".nav_arrow",function(){ $(this).parent("li").toggleClass("cur"); $(this).parent("li").siblings().removeClass("cur"); }) $(document).on("click",".nav_return",function(){ $(this).parents("li").removeClass("cur"); }) } } function ScollText(obj){ if($(obj).length>0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } function wowInt(){ if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 100, mobile: false, live: true }); wow.init(); }; } /*鎵嬫満绔摼鎺ユ敼涓烘湰绐楀彛鎵撳紑*/ function phoneTargetSelf(context){ if ($(window).width()<1024) { if(context==undefined){ context=$(document); } $('a',context).each(function(){ var target=$(this); var link=target.attr('target'); target.attr('target','_self'); }) } } /*鐢佃瘽閾炬帴鍙栨秷榛樿浜嬩欢骞舵坊鍔犳牱寮?/ function findTel(context){ if ($(window).width()>1024) { var condition = /^tel\:([0-9\-]+)|tel\:\+([0-9\-]+)$/; if(context==undefined){ context=$(document); } $('a',context).each(function(index, el) { var target=$(this); var href=target.attr('href'); if (condition.test(href)) { target.addClass('tel_link'); target.on('click',function(event){ event.preventDefault(); }) } }); } } /*ie9鐨刾laceholder鍖呭惈瀵嗙爜妗嗙殑鍏煎*/ $(function() { // 濡傛灉涓嶆敮鎸乸laceholder锛岀敤jQuery鏉ュ畬鎴 if(!isSupportPlaceholder()) { // 閬嶅巻鎵€鏈塱nput瀵硅薄, 闄や簡瀵嗙爜妗 $('input').not("input[type='password']").each( function() { var self = $(this); var val = self.attr("placeholder"); input(self, val); } ); /**//* 瀵筽assword妗嗙殑鐗规畩澶勭悊 * 1.鍒涘缓涓€涓猼ext妗 * 2.鑾峰彇鐒︾偣鍜屽け鍘荤劍鐐圭殑鏃跺€欏垏鎹 */ $('input[type="password"]').each( function(i) { var pwdField = $(this); var pwdVal = pwdField.attr('placeholder'); var pwdId = pwdField.attr('id'); // 閲嶅懡鍚嶈input鐨刬d涓哄師id鍚庤窡1 pwdField.after(''); var pwdPlaceholder = $('#' + pwdId + ''+i+''); pwdPlaceholder.show(); pwdField.hide(); pwdPlaceholder.focus(function(){ pwdPlaceholder.hide(); pwdField.show(); pwdField.focus(); }); pwdField.blur(function(){ if(pwdField.val() == '') { pwdPlaceholder.show(); pwdField.hide(); } }); } ); } }); // 鍒ゆ柇娴忚鍣ㄦ槸鍚︽敮鎸乸laceholder灞炴€ function isSupportPlaceholder() { var input = document.createElement('input'); return 'placeholder' in input; } // jQuery鏇挎崲placeholder鐨勫鐞 function input(obj, val) { var $input = obj; var val = val; $input.attr({value:val}); $input.focus(function() { if ($input.val() == val) { $(this).attr({value:""}); } }).blur(function() { if ($input.val() == "") { $(this).attr({value:val}); } }); } //end //--------------鐐瑰嚮鍒嗕韩 function share(){ $(".share_facebook").click(function () {//Facebook var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.facebook.com/sharer.php?s=100&p[title]=" + title + "&p[summary]=!&p[url]=" + encodeURIComponent(url) + "" window.open(op) }) $(".share_twitter").click(function () {//Twitter var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.tumblr.com/login?redirect_to=https://www.tumblr.com/widgets/share/tool?shareSource=legacy&canonicalUrl=&url=" + encodeURIComponent(url) + "&title=" + title + ""; window.open(op) }) $(".share_wb").click(function () {//寰崥 var url = $(this).data("txt"); var url = window.location.href; // var title = document.title; var title = $(".d_title h1").text(); var op = "http://service.weibo.com/share/share.php?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op) }) $(".share_qqkj").click(function () {//鑵捐寰崥 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op) }) $(".share_qq").click(function () {//QQ var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://connect.qq.com/widget/shareqq/index.html?url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_douban").click(function () {//璞嗙摚 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.douban.com/share/service?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_bd").click(function () {//鐧惧害璐村惂 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://s.share.baidu.com/mshare?url=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) //寰俊 $(".share_wx").attr("data-qrcode","https://www.xinhongru.com/qrcode/qrcode.php?content="+window.location.href); $(".share_wx").click(function () {//寰俊 //var url = "/qrCode/Index.aspx?url=" + window.location.href; var url = $(this).attr("data-qrcode") console.log(url) var title = "" title += "
" title += "x" title += "

浜岀淮鐮?/h2>" title += "
" title += "

鎵竴鎵?/p>" title += "

" $("body").remove(".weixin"); $("body").append(title) }) $(document).on("click", ".weixin .c", function () { $(".weixin").remove(); }) } function mapInt(mapTitle,mapAdress,mapx,mapy){ var num = 0.001; var map = new BMap.Map("map"); var point = new BMap.Point(mapx+num,mapy); var point2 = new BMap.Point(mapx,mapy); var myIcon = new BMap.Icon("../images/mapaddress.png", new BMap.Size(222,128)); var marker2 = new BMap.Marker(point2,{icon:myIcon}); map.addOverlay(marker2); map.centerAndZoom(point, 19); if($(window).width()<767){ num = 0; map.centerAndZoom(point2, 19); } map.enableScrollWheelZoom(); map.enableContinuousZoom(); } function select02(){ $(".pub_select").each(function (i) { $(this).find("dt").click(function (e) { if($(this).hasClass('on_o')){ $(this).removeClass('on_o'); }else{ $(this).addClass('on_o'); } e.preventDefault(); e.stopPropagation() $(".pub_select").eq(i).find("dd a").each(function (x) { $(this).click(function () { $(".pub_select").removeClass("on"); $(".pub_select").eq(i).find("dd a").removeClass("on") $(this).addClass("on") $(".pub_select").eq(i).find("dt p").text($(this).text()); $(".pub_select").eq(i).find("dt").attr({"data-val":$(this).data("val")}); }) }) }) }) $(document).click(function () { $(".pub_select dd").slideUp(); $(".pub_select dt").removeClass('on_o'); }) $(".pub_select dt").on("click", function(e){ if($(this).siblings(".pub_select dd").is(":hidden")){ $(this).parents("li").siblings().find(".pub_select dd").slideUp(); $(this).siblings(".pub_select dd").slideDown(); $(this).parents(".pub_select").siblings(".pub_select").children(".pub_select dd").slideUp(); }else{ $(this).siblings(".pub_select dd").slideUp(); } }); } $(function(){ museumSlider(); }) function museumSlider(){ if($(window).width()>1024){ if($("html").hasClass("ie9")){ if($(".ie9 .museum_slider li").length>1){ $(".ie9 .museum_slider .public_but").show(); var mySwiper = new Swiper('.ie9 .museum_slider .swiper-container',{ slidesPerView: 3, slidesPerGroup: 1, spaceBetween: 20, loop:true, nextButton: '.ie9 .museum_slider .swiper-button-next', prevButton: '.ie9 .museum_slider .swiper-button-prev', }) }else{ $(".museum_01").addClass("nocur") } }else{ if($(".museum_slider li").length>1){ $(".museum_slider .public_but").show(); var mySwiper = new Swiper('.museum_slider .swiper-container',{ loop: true, // autoplay:5000, slidesPerView: "auto", centeredSlides:true, loopAdditionalSlides:100, spaceBetween: "2.6%", nextButton: '.museum_slider .swiper-button-next', prevButton: '.museum_slider .swiper-button-prev', pagination : '.museum_slider .swiper-pagination', paginationType: 'fraction', paginationClickable :true, autoplayDisableOnInteraction : false, }) }else{ $(".museum_01").addClass("nocur") } } }else{ if($(".museum_slider li").length>1){ $(".museum_slider .public_but").show(); var mySwiper = new Swiper('.museum_slider .swiper-container',{ loop: false, // autoplay:5000, slidesPerView: 1, nextButton: '.museum_slider .swiper-button-next', prevButton: '.museum_slider .swiper-button-prev', pagination : '.museum_slider .swiper-pagination', paginationType: 'fraction', paginationClickable :true, autoplayDisableOnInteraction : false, }) }else{ $(".museum_01").addClass("nocur") } } } function culture_animate(){ $(".culture_index01").each(function(){ $(this).find("li").eq(0).addClass("on"); }) if ($('.culture_index01').length>0) { $(".culture_index01 li").hover(function(){ $(this).addClass("on").siblings().removeClass("on"); $(this).parents(".culture_index01").attr('class','culture_index01 statemove_'+($(this).index()+1)); }) } $(".culture_index03").each(function(){ $(this).find("li").eq(0).addClass("on"); }) if ($('.culture_index03').length>0) { $(".culture_index03 li").hover(function(){ $(this).addClass("on").siblings().removeClass("on"); $(this).parents(".culture_index03").attr('class','culture_index03 stateidea_'+($(this).index()+1)); }) } } function recruitslider(){ if($(window).width()>767){ if($(".recruit_slider li").length>3){ $(".recruit_slider .public_but").show(); }else{ } }else{ if($(".recruit_slider li").length>1){ $(".recruit_slider .public_but").show(); }else{ } } if($(".recruit_slider li").length>0){ var brand3Swiper = new Swiper('.recruit_slider .swiper-container', { slidesPerView: 3, slidesPerGroup: 1, spaceBetween: 60, prevButton:'.recruit_slider .swiper-button-prev', nextButton:'.recruit_slider .swiper-button-next', breakpoints:{ 1440: { spaceBetween:20 }, 767: { slidesPerView: 1, slidesPerGroup: 1, spaceBetween:0 }, } }) } }