// JavaScript Document $(function(){ // 新闻页多行文本省略 $(".news_list li").each(function(i) { var target = $(this).find(".summary"); var txt1 = target.text(); var txt2 = txt1.substring(0,81); target.html(txt2 + '···'); }); //链接到新页面 $(".js-contact-html").click(function(event) { window.location.href = "/about/index.html#contract"; }); //媒体报道信息翻页 $(".slide_page a").click(function(){ var a_index = $(this).index(); var left_num = 1180*a_index; $(this).addClass("current").siblings("a").removeClass("current"); $(this).parents().find(".list_ul").animate({left:"-"+left_num+"px"},500); }) //视频弹层打开 var w = $(window).width(); var h = $(window).height(); $(".video_box").css("top",w/2-590); $(".video_box").css("top",h/2-313); $(".play_link a").click(function(){ $(".background_box").fadeIn("slow"); $(".video_box").fadeIn("slow"); }) //视频弹层关闭 $(".video_close").click(function(){ $(".background_box").fadeOut("slow"); $(".video_box").fadeOut("slow"); }) //服务条款tab $("body").on('click', '.js-show-hide', function(event) { var tar = $(this).attr("data-tab"); var tt = $("#" + tar); $(this).children('a').addClass('cur').end().siblings().children('a').removeClass('cur'); tt.show().siblings('.item-info').hide(); }); $(window).scroll(function(event) { var h1 = $(".cul_banner").height(); var h2 = $(".cul_nav").height(); var h3 = $(".box12 .item_r").height(); var h = h1 + h2; var scrollH = $(window).scrollTop(); if ($(window).width() >= 1180) { if (scrollH >= h && scrollH <= (h+h3-195)) { $(".box12 .item_l").addClass('item_fixed'); } else { $(".box12 .item_l").removeClass('item_fixed'); } } else { $(".box12 .item_l").removeClass('item_fixed'); } }); // 分享功能 $(".js-share-show").hover(function() { $(this).children('.share').show(); }, function() { $(this).children('.share').hide(); }); $(".share .close").click(function(event) { $(this).parent().hide(); }); function shareBtn() { var curUrl = window.location.href; var curTxt = $("title").text(); window._bd_share_config = { common : { bdUrl : curUrl, bdText : curTxt }, share : [{ "bdSize" : 16 }], selectShare : [{ "bdselectMiniList" : ['weixin','qzone','tsina','tqq',] }] } with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)]; }; shareBtn() })