// /*引入页首、页脚*/ /*(function () { var url = location.href; $.each($('#j-header-nav-ul li'), function () { // console.log($(this).attr("target")) if (url.indexof($(this).attr("target")) !== -1) { $(this).addclass('header-active').siblings().removeclass('header-active'); } }) }());*/ $('#searchbutton').click(function(){ let keywords=$(" #keywords ").val(); if (!keywords) { layer.msg('您输入的内容为空.......'); return ; } let urli=gv.project_url+"/portal/search/index?keyword="+keywords; location.href = urli ; }); $('#keywords').keydown(function(event){ if(event.keycode===13) { let keywords = $(" #keywords ").val(); if (!keywords) { layer.msg('您输入的内容为空.......'); return; } let url2 = gv.project_url + "/portal/search/index?keyword=" + keywords; location.href = url2; } }); $('#searchbuttonen').click(function(){ let keywords=$(" #keywordsen ").val(); if (!keywords) { layer.msg('您输入的内容为空.......'); return ; } let urli=gv.project_url+"/portal/searchen/index?keyword="+keywords; location.href = urli ; }); $('#keywordsen').keydown(function(event){ if(event.keycode===13) { let keywords = $(" #keywordsen ").val(); if (!keywords) { layer.msg('您输入的内容为空.......'); return; } let url2 = gv.project_url + "/portal/searchen/index?keyword=" + keywords; location.href = url2; } }); (function () { var $ul = $("#j-header-nav-ul"); if ($(window).width() > 1024) return; document.getelementbyid("j-header-btn").addeventlistener("click", function () { if ($(this).find("i").hasclass("icon-shouqi1")) { if ($ul.is(":animated")) { return false; } $(this).find("i").addclass("icon-x").removeclass("icon-shouqi1"); $ul.slidetoggle("1000"); } else { if ($ul.is(":animated")) { return false; } $(this).find("i").addclass("icon-shouqi1").removeclass("icon-x"); $ul.slidetoggle("1000"); } }, false) }()); /*分页*/ (function (elem) { if (!elem[0]) return; var url = elem.attr('url'), cur = number(elem.data('page')), //当前页码 total = number(elem.data('total')), //总页码 view = number(total > 5 ? 5 : total), //每次展示的页码数 min = 1, //当前展示的最小页码 max = total, //当前展示的最大页码 half = math.ceil(view / 2), str = ''; var width = $(window).width(); if (total > view) { if (cur <= half) { min = 1; max = min + view - 1; } else if (cur > half && cur < total - half + 1) { min = cur - half + 1; max = cur + half - 1; } else { min = total - (view - 1); max = total; } } if(url.indexof("search")!==-1) str += cur == 1 ? '' : '上一页' else str += cur == 1 ? '' : '上一页' //pc端 str += cur > half && total > view ? '...' : ''; for (var i = 0; i < view; i++) { if (cur == min + i) str += '' + (min + i) + '' else if(url.indexof("search")!==-1) str += '' + (min + i) + ''; else str += '' + (min + i) + ''; } str += cur < total - half + 1 && total > view ? '...' : ''; if(url.indexof("search")!==-1){ str += cur == total ? '' : '下一页'; } else{ str += cur == total ? '' : '下一页'; } elem.prepend(str); elem.find('select').on('change', function () { location.href = url + $(this).val(); }); })($('#pagebox')); /*分页-英文*/ (function (elem) { if (!elem[0]) return; var url = elem.attr('url'), cur = number(elem.data('page')), //当前页码 total = number(elem.data('total')), //总页码 view = number(total > 5 ? 5 : total), //每次展示的页码数 min = 1, //当前展示的最小页码 max = total, //当前展示的最大页码 half = math.ceil(view / 2), str = ''; var width = $(window).width(); if (total > view) { if (cur <= half) { min = 1; max = min + view - 1; } else if (cur > half && cur < total - half + 1) { min = cur - half + 1; max = cur + half - 1; } else { min = total - (view - 1); max = total; } } if(url.indexof("search")!==-1) str += cur == 1 ? '' : 'previous' else str += cur == 1 ? '' : 'previous' //pc端 str += cur > half && total > view ? '...' : ''; for (var i = 0; i < view; i++) { if (cur == min + i) str += '' + (min + i) + '' else if(url.indexof("search")!==-1) str += '' + (min + i) + ''; else str += '' + (min + i) + ''; } str += cur < total - half + 1 && total > view ? '...' : ''; if(url.indexof("search")!==-1){ str += cur == total ? '' : 'next'; } else{ str += cur == total ? '' : 'next'; } elem.prepend(str); elem.find('select').on('change', function () { location.href = url + $(this).val(); }); })($('#pagebox_en')); /*二级导航栏*/ window.onresize = function (){ subnav() } subnav() function subnav() { var navoffset = $("#j-header-nav-ul").offset().left; //console.log(navoffset) var bodywidth = document.body.clientwidth var lis = $("#j-header-nav-ul>li") for (var i = 0; i < lis.length -1; i++){ var headernavliswidth = $('.company-profile-sub-nav'+i+'').width() var headernavleft = ($('#j-header-nav-ul>li:nth-of-type(' + (i + 2) +')').offset().left + ($('#j-header-nav-ul>li:nth-of-type('+ (i + 2)+')').width() - 14) / 2) / bodywidth * 100 var headernavliswidth2 = headernavliswidth / 2 var headernavlistyle = '' $('.company-profile-sub-nav'+i+'').append(headernavlistyle) } }; (function () { var headerliindex=0 var headerlis = $("#j-header-nav-ul>li:not('.header-first-li')") for (var i = 0; i < headerlis.length; i++) { // console.log(headerlis) if ($(headerlis[i]).hasclass("header-active")) { headerliindex = $(headerlis[i]).index() } } //console.log(headerliindex) $("#j-header-nav-ul>li>a").mouseenter(function () { $(this).parents().children(".header-sub-nav").css({ opacity: '1', zindex: '999', }) $(this).parents().siblings().children(".header-sub-nav").css({ opacity: '0', zindex: '-900', }) }).eq(headerliindex).trigger("mouseenter"); })(); (function () { if ($(window).width() > 767) return; var lis = $(".company-profile-ul li") if ((lis.length) % 3 != 3) { console.log((lis.length) % 3 ) for (var i = 0; i < (3 - (lis.length) % 3 ); i++){ var li = '
' $(".company-profile-ul").append(li) } } })(); // $('a[href*=#],area[href*=#]').click(function () { // if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { // var $target = $(this.hash); // $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']'); // if ($target.length) { // var targetoffset = $target.offset().top; // $('html,body').animate({ // scrolltop: targetoffset // }, // 1000); // return false; // } // } // }); $(".return-top").click(function () { //$("html, body").animate({ scrolltop: $($(this).attr("href")).offset().top - 20 + "px" }, 1000); //console.log("666") $("html, body").animate({ scrolltop: 0 }, 1000); return false; }); (function () { var scrollheight = document.body.scrollheight; var clientheight = document.body.clientheight; var scrolltop = document.body.scrolltop; //如果不加时间控制,滚动会过度灵敏,一次翻好几屏 var starttime = 0, //翻屏起始时间 endtime = 0; //浏览器兼容 if ((navigator.useragent.tolowercase().indexof("firefox") != -1)) { document.addeventlistener("dommousescroll", scrollfun, false); } else if (document.addeventlistener) { document.addeventlistener("mousewheel", scrollfun, false); } else if (document.attachevent) { document.attachevent("onmousewheel", scrollfun); } else { document.onmousewheel = scrollfun; } //滚动事件处理函数 function scrollfun(event) { starttime = new date().gettime(); var delta = event.detail || (-event.wheeldelta); //mousewheel事件中的 “event.wheeldelta” 属性值:返回的如果是正值说明滚轮是向上滚动 //dommousescroll事件中的 “event.detail” 属性值:返回的如果是负值说明滚轮是向下滚动 if ((endtime - starttime) < -500) { if (delta > 0) { //向下滚动 if (scrollheight > clientheight) { $(".return-top").css({ opacity: '1' }) } } if (delta < 0) { //向上滚动 if (scrollheight > clientheight) { $(".return-top").css({ opacity: '0' }) } } endtime = new date().gettime(); // console.log(now/hei) } else { // event.preventdefault(); } } })(); var $lis = $(".company-profile-ul li") var $bus = $(".group-business-all-business>div>div:nth-of-type(2) ") if (gv.session === 'en') { $lis.css({ "font-size": "7px" }) $bus.css({ "font-size":"14px" , "width":" 100% ", "right":"8 %", "top":"57px", "text-align":" center", "text-transform": " uppercase", "right": "8%", "font-weight":"normal" }) $(".group-business-all-business>div>div:nth-of-type(2) span:nth-of-type(1)").css({ "text-align": " center", }) $(".group-business-item-name").css({ "line-height":"18px" }) // $(".header-sub-nav li>a").css({ // "font-size": "12px", // }) }