$(function () { wowInt(); findTel(); phoneTargetSelf(); nav(); search(); share(); select(); //public_ajax(); //ScollText(".about-part01 .rr .txt"); //wowDelay(".index-part01 ul",$('.index-part01 ul li').length,"0.2"); if($(window).width()>1024){ $('.rr_top .lang dt').mouseenter(function(){ $(this).parent("dl").addClass("on"); }) $('.rr_top .lang').mouseleave(function(){ $(this).removeClass("on"); }) } else{ $('.lang dt').click(function(e){ e.preventDefault(); e.stopPropagation(); $(this).parent("dl").toggleClass("on"); }) $(document).click(function(){ $('.lang').removeClass("on"); }) } //椤堕儴鎮诞 if($(window).width()>1024){ $(window).scroll(function(){ if($(window).scrollTop()>0){ $("body").addClass("scroll-header"); }else{ $("body").removeClass("scroll-header"); } }) } $(".foot_tt .ll li").hover(function(){ $(this).addClass("on").siblings().removeClass("on"); }) }) function select(){ $(".select-box").each(function (i) { $(this).find("dt").click(function (e) { $(this).siblings().slideToggle(); $(this).parents(".select-wrap").siblings().find("dd").slideUp(); $(this).parents(".select-wrap").siblings().find("dt").removeClass('on_o'); $(this).parents("li").siblings().find("dd").slideUp(); $(this).parents("li").siblings().find("dt").removeClass('on_o'); if($(this).hasClass('on_o')){ $(this).removeClass('on_o'); }else{ $(this).addClass('on_o'); } e.preventDefault(); e.stopPropagation() $(".select-box").eq(i).find("dd a").each(function (x) { $(this).click(function () { var jj=$(this).index(); $(".select-box").eq(i).find("dd a").removeClass("on"); $(this).addClass("on"); $(".select-box").eq(i).find("dt a").text($(this).text()); $(".select-box").eq(i).find("dt").parent().next().val($(this).text()); $(".index-part04 .ll .itemlist li").eq(jj).addClass("on").siblings().removeClass("on"); $(".index-part04 .rr .tit li").eq(jj).addClass("on").siblings().removeClass("on"); $(".index-part04 .rr .img li").eq(jj).addClass("on").siblings().removeClass("on"); }) }) }) }) $(document).click(function () { $(".select-box dd").slideUp(); $(".select-box dt").removeClass('on_o'); }) $(".select-box dt").on("click", function(e){ if($(this).siblings(".select-box dd").is(":hidden")){ $(this).siblings(".select-box dd").slideDown(); }else{ } }); } //public_ajax鍔犺浇鏇村涓嬩竴椤 function public_ajax() { if($(".ajLoad").length>0){ var $resourceTypeList = $('.ajLoad ul'); $resourceTypeList.infinitescroll({ navSelector: "#public_more", nextSelector: "#public_more a", itemSelector: ".public_li", clickb: true, clickobj: ".public_loadmore", loading: { img: "../images/loading.gif", msgText: ' ', finishedMsg: '', finished: function() { $("#infscr-loading").remove(); imgratio(); } }, errorCallback: function() { $(".public_loadmore").after("
娌℃湁浜咟/div>"); $(".public_loadmore").hide(); setTimeout(function () { $(".finMessage").fadeOut(); }, 500) } }, function(newElements) { var $newElems = $(newElements); $newElems.fadeIn(); return; }); } } 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); if($(window).width()>=1024){ map.centerAndZoom(point, 18); var myIcon = new BMap.Icon("../images/dot24.png", new BMap.Size(80,120)); var marker2 = new BMap.Marker(point2,{icon:myIcon}); map.addOverlay(marker2); } else{ num = 0; map.centerAndZoom(point2, 16); var myIcon = new BMap.Icon("../images/dot24_phone.png", new BMap.Size(40,60)); var marker2 = new BMap.Marker(point2,{icon:myIcon}); map.addOverlay(marker2); } var mapStyle = { features:["road","building","water","land"],//闅愯棌鍦板浘涓婄殑鈥減oi鈥 style:"grayscale" }; map.setMapStyle(mapStyle); map.enableScrollWheelZoom(); map.enableContinuousZoom(); } //caseAjax function caseAjax(str,url){ $.ajax({ url:url, success:function(msg){ $(str).html(""); $(str).append(msg); } }); } //涓诲鑸 function nav(){ if($(window).width()>1024){ $(".nav ul>li").hover(function() { $(this).find(".navlist").stop().slideDown(); }, function() { $(this).find(".navlist").stop().slideUp(); }); $(".nav_all .ll li").hover(function () { var ii = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); $('.nav_all .rr li').eq(ii).addClass("on").siblings().removeClass("on"); },function(){ }); $(".nav_all .ll li").eq(0).addClass("on"); $(".nav_all .rr li").eq(0).addClass("on"); $(".nav_all").hover(function () { },function(){ $('.nav_phone_btn').removeClass('visible_nav'); $('body').removeClass('body_nav'); }); }else{ $(".navlist").siblings("span").addClass("cur"); $(document).on('click','.nav_phone_btn',function(e){ e.preventDefault(); e.stopPropagation(); $('.nav_phone_btn').toggleClass('visible_nav'); $('body').toggleClass('body_nav_phone'); $(".nav ul li").find(".navlist").slideUp(); $(".nav ul li").find("span").removeClass("on"); }); $(document).on('click','.nav ul li span',function(e){ $(this).parent("li").siblings().find("span").removeClass("on"); $(this).parent("li").siblings().find(".navlist").slideUp(); $(this).toggleClass("on"); $(this).siblings(".navlist").slideToggle(); }) } } //鎼滅储 function search(){ $(document).on("click", "span.ser", function (e) { e.preventDefault(); e.stopPropagation(); $(this).toggleClass("on"); $(".search_wrap").toggleClass("on"); $(".f_link dd").stop().slideUp(); }) $(document).on("click", ".search_box_text", function (e) { e.preventDefault(); e.stopPropagation(); }) $(document).click(function(){ $(".search_wrap").removeClass("on"); $("span.ser").removeClass("on"); $(".f_link dd").stop().slideUp(); }) } function share(){ $(".share_wb").click(function () { var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://service.weibo.com/share/share.php?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op) }) $(".share_in").click(function () {//linkedin var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://www.linkedin.com/uas/login?title=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_tw").click(function () {//twitter var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "http://twitter.com/intent/tweet?text=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_zh").click(function () {//鐭ヤ箮 var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://www.zhihu.com/signin?next=%2F?text=" + title + "&url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_kj").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 () { 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_sh").click(function () { var url = $(this).data("txt"); var url = window.location.href; var title = document.title; var op = "https://mp.sohu.com/mpfe/v3/login?url=" + encodeURIComponent(url) + ""; window.open(op); }) $(".share_wx").attr("data-qrcode","http://www.xinhongru.com/qrcode/qrcode.php?content="+window.location.href); //$(".share_wx").attr("data-qrcode", "/qrCode/Index.aspx?url=" + 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(); }) } //wow鍏ュ満 function wowInt(){ if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 10, mobile: true, live: true }); wow.init(); }; } function wowDelay(box,row,delayTime){ $(box).children().each(function(index){ for(var i = 0;i0){ $(obj).mCustomScrollbar({ mouseWheelPixels:500, autoDraggerLength:false, advanced: { autoScrollOnFocus: "" } }); } } /*鎵嬫満绔摼鎺ユ敼涓烘湰绐楀彛鎵撳紑*/ 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(){ if(!placeholderSupport()){ // 鍒ゆ柇娴忚鍣ㄦ槸鍚︽敮鎸 placeholder $('input').not("input[type='password']").each( function() { var self = $(this); var val = self.attr("placeholder"); input(self, val); /*if($(this).val()=="" && $(this).attr("placeholder")!=""){ $(this).val($(this).attr("placeholder")); $(this).focus(function(){ if($(this).val()==$(this).attr("placeholder")) $(this).val(""); }); $(this).blur(function(){ if($(this).val()=="") $(this).val($(this).attr("placeholder")); }); }*/ } ); $('input[type="password"]').each( function() { var pwdField = $(this); var pwdVal = pwdField.attr('placeholder'); var pwdClass = pwdField.attr('class'); // 閲嶅懡鍚嶈input鐨刬d涓哄師id鍚庤窡1 pwdField.after(''); var pwdPlaceholder = $(this).siblings('.login-input'); 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 placeholderSupport() { return 'placeholder' in document.createElement('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