_setting = { toggleImageSize: true, toggleLazyload: true, imgUrl: 'images/', menufixTriger: 250 } $(window).scroll(function () { scrollx = $(document).scrollTop(); basic.lazyload(); gobal.menufix(); }); $(window).resize(function () { ww = $(window).width(); }); var $index_i = 0; var $max = null; var $timer = null; $(document).ready(function () { if($('#zh-page').length>0){ $('.go-big').on('click',function () { $('.other').fadeIn(); }); $('.mask,.close').on('click',function () { $('.other').fadeOut(); }); function scrollToLocation() { var mainContainer = $('.map-box'), half = mainContainer.height()/4, box = mainContainer.find('img').height(); mainContainer.animate({ scrollTop: box/2 - half }, 10);//2绉掓粦鍔ㄥ埌鎸囧畾浣嶇疆 } scrollToLocation(); } ww = $(window).width(); // alert(ww);1024:704 672 // alert($(window).height()); scrollx = $(document).scrollTop(); basic.table(); basic.animated(); _setting.toggleLazyload ? basic.lazyload() : null; _setting.toggleImageSize ? basic.imgsize() : null; // basic.grids(); basic.deviceRotate(); // nicescroll(); // mousewheel(); if (ww > 768) { gobal.menufix(); } gobal.sitemap(); gobal.terms(); gobal.bookmark(); gobal.active(); ww <= 1024 ? gobal.toggleMenu() : null; ww <= 1024 && $('.content .left').size() > 0 ? gobal.touchSwiper() : null; index.banner(); about.gongsigaikuang(); about.milestone(); about.response(); news.companynews(); news.mediaNews(); bussiness.main(); bussnet.interact(); join.talent(); $('#framework').click(function () { if ($(window).width() <= 768 && mobile()) { $_w = $(this).attr('data-width'); $_h = $(this).attr('data-height'); $('.bigview .con').css({ 'width': $_w, 'height': $_h }); $('.bigview').fadeIn(); } }); $('body').click(function () { $('.bigview').fadeOut(); }); $('#framework').click(function (e) { e.stopPropagation(); }); // $('.newsDetial .detial p').removeAttr('style'); if (ww > 768) { $('.we .detial .mandetial .con').niceScroll({ cursorcolor: "none", background: 'none', cursorwidth: '5', cursorborder: "none", cursorborderradius: "0", cursoropacitymin: '0.5', cursoropacitymax: '1', horizrailenabled: false, smoothscroll: false }); } $('.platfrom .block .tar a').click(function () { $(this).parent('.tar').parent('.row').toggleClass('active'); }); $pingtaislider = $('.jinqu .pingtai .slider').bxSlider({ mode: 'fade', pager: false, controls: false, onSliderLoad: function () { $('.jinqu .pingtai .tabs li').click(function () { $eq = $(this).index(); $(this).addClass('active').siblings('li').removeClass('active'); $pingtaislider.goToSlide($eq); }); } }); $('.duocai .album').each(function (i) { $this = $(this); $slider = $this.find('.imgs .slider'); $preview = $(this).find('.imgs .preview'); $preview.attr('aid', i); (function (w) { $sliderf[w] = $slider.bxSlider({ auto: false, pager: false, controls: false, auto: true, pause: 3e3, onSlideBefore: function ($slideElement, oldIndex, newIndex) { $('.duocai .album:eq(' + w + ') .preview li').eq(newIndex).addClass('active').siblings().removeClass('active'); } }); })(i); }); $('.duocai .album .preview li').click(function () { $fid = $(this).parent('.preview').attr('aid'); $eq = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $sliderf[$fid].goToSlide($eq); }); // 鎷涜仒璇︽儏 if (ww > 800) { _margin = 20; _itemwidth = ($('.detial .gaikuang .pics .items').width() - _margin * 2) / 3; $('.detial .gaikuang .pics .items').css({ width: $('.detial .gaikuang .pics .item').size() * (_itemwidth + _margin) }); $('.detial .gaikuang .pics .item').css({ width: _itemwidth, marginRight: _margin }); } if (ww <= 800) { _html = ''; $('.detial .gaikuang .pics .items .item').each(function () { _html += '
  • '; }); $('.detial .gaikuang .pics .items').html(''); $('.detial .gaikuang .pics .items .slider').bxSlider({ auto: true, pause: 3e3, pager: false, prevText: '涓婁竴椤?, nextText: '涓嬩竴椤? }); } }); var join = { talent: function () { $('.talent').find('.item').each(function (i) { i++; $(this).addClass('item' + i); }); faceScale(); function faceScale() { $('.talent .item .face').ratio({ scale: 1 }); if ($(window).width() > 480) { if ($('.talent').size() > 0) { _width = $('.talent .item .face').width(); _mgT = 0 - (_width / 2); $('.talent .item .face').css({ marginTop: _mgT }); } } } $(window).resize(function () { faceScale(); }); } } var relation = { csuite: function (data) { if (typeof (data) != 'undefined') { $items = $('
    '); $.each(data, function (key, data) { $item = $('
    '); $left = $('

    ' + data.jobname + '

    '); $right = $('
    '); $.each(data.member, function (k, member) { member.sex == '濂? ? _class = "female" : _class = ''; $right.append($('
    ' + member.name + '

    ' + member.sex + ' ' + member.birth + '

    ')); }); $item.append($left).append($right); $items.append($item); }); $('.managers').append($items); } else { console.warn('鍑洪敊浜嗭紝relation.csuite()涓殑data鏁版嵁鏈畾涔夈€?); } }, shareholder: function (data) { if (typeof (data) != 'undefined') { $items = $('
    '); $.each(data, function (k, holder) { $item = $('

    ' + holder.name + '

    鎸佽偂鏁伴噺锛欬b>' + holder.amount + '
    鎸佽偂姣斾緥锛欬b>' + holder.percent + '
    鑲′唤鎬ц川锛欬b>' + holder.prop + '
    '); $items.append($item); }); $('.shareholder').append($items); } else { console.warn('鍑洪敊浜嗭紝relation.shareholder()涓殑data鏁版嵁鏈畾涔夈€?); } } } var bussnet = { interact: function () { $('.bussnet .filter .input select').on('change', function () { company = $('#company').val(); nation = $('#nation').val(); province = $('#province').val(); city = $('#city').val(); bussnet.getInfo(nation, province, city, company); }); }, getInfo: function (nation, province, city, company, is_default) { $.post('business.html?network', { "get_company": 1, "company": company, "nation": nation, "province": province, "city": city, "is_default": is_default }, function (result) { // alert(result); // alert(1); result = eval("(" + result + ")"); _html = '
    '; $.each(result, function (i, data) { _company = data.company; _city = data.city; _contact = data.contact.replace(/\n/g, "
    "); _html += '

    ' + _company + '

    鍩庡競: ' + _city + '

    ' + _contact + '

    '; // alert(i + ': ' + _company +','+_city + ',' + _contact +',' + _html); }); _html += '
    '; $('.bussnet .result').removeClass('fadeInRight animated').addClass('fadeOutLeft animated'); setTimeout(function () { $('.bussnet .result').html(_html); $('.bussnet .result').removeClass('fadeOutLeft animated').addClass('fadeInRight animated'); basic.animated(); }, 400); }); } } var bussiness = { main: function () { // tabpage $('.tabpage .tab').on('click', 'li', function () { index = $(this).index(); $(this).addClass('active').siblings().removeClass('active'); $('.tabpage .pages').find('.page').eq(index).addClass('active').siblings().removeClass('active'); }); // ajax $('.products .filter .items').on('mouseenter', 'li', function () { $(this).addClass('active').siblings().removeClass('active'); type = $(this).attr('type'); bussiness.getInfo(type); }); $('.products .filter .items').on('click', 'li', function () { $(this).addClass('active').siblings().removeClass('active'); type = $(this).attr('type'); bussiness.getInfo(type); }); // sidebar barScroll = 0; current = 0; typeSize = $('.products .filter .items li').size(); typeHeight = $('.products .filter .items li').outerHeight(); if ($(window).width() > 480) { $('.products .filter .arrows').on('click', '.btn', function () { activeLi = $('.products .filter .items .active').index(); if ($(this).hasClass('next')) { if (current > 0) { current--; barScroll -= typeHeight; $('.products .filter .items').animate({ scrollTop: barScroll }, 500); } } else { if (current < typeSize - 3) { current++; barScroll += typeHeight; $('.products .filter .items').animate({ scrollTop: barScroll }, 500); } } if (activeLi < current) { activeLi += 1; $('.products .filter .items li').eq(activeLi).click(); } if (activeLi > current + 2) { activeLi -= 1; $('.products .filter .items li').eq(activeLi).click(); } }); } else { $maxScroll = (Math.ceil(typeSize / 3) - 1) * typeHeight; $('.products .filter .arrows').on('click', '.btn', function () { if ($(this).hasClass('prev')) { if (barScroll < $maxScroll) { barScroll += typeHeight; } } else { if (barScroll >= 0) { barScroll -= typeHeight; } } $('.products .filter .items').animate({ scrollTop: barScroll }, 500); }); $('.products .filter').swipe({ swipe: function (event, direction, distance, duration, fingerCount, fingerData) { if (direction == 'up' || direction == 'left') { if (barScroll < $maxScroll) { barScroll += typeHeight; } } else { if (barScroll > 0) { barScroll -= typeHeight; } } $('.products .filter .items').animate({ scrollTop: barScroll }, 500); } }); } }, getInfo: function (pid) { // $('.products .filter .items>li').each(function () { // if ($(this).attr('type') == pid) { // $(this).addClass('active').siblings().removeClass('active'); // } // }); $.post("business.html", { "pid": pid }, function (result) { data = eval('(' + result + ')'); // 浜у搧 _description = ''; // 鏍稿績鑳藉姏 _capacity = ''; // 琛屼笟鍦颁綅 _position = ''; // 杩愯惀鍗曚綅 _entity = ''; // 浼樺娍鏈嶅姟 _service = ''; // 缁忚惀鍗曚綅 _operator = '
    '; // $operator = data.operator; // wwwreg = /www\.\w*\.\w*/g; // $.each($operator, function (i, info) { // _operator += '
    '; // _operator += '

    ' + info.company + '

    '; // //_operator+='

    '+info.contact.replace(/\n/g,'
    ').replace(wwwreg,''+RegExp.$1+'')+'

    '; // _operator += '

    ' + info.contact.replace(/\n/g, '
    ') + '

    '; // _operator += '
    '; // }); $operator = data.industry_scope.operating_scope; wwwreg = /www\.\w*\.\w*/g; _operator += '
    '; //_operator+='

    '+info.contact.replace(/\n/g,'
    ').replace(wwwreg,''+RegExp.$1+'')+'

    '; _operator += '

    ' + $operator.replace(/\n/g, '
    ') + '

    '; _operator += '
    '; _operator += '
    '; // 浠g悊鍝佺墝 $agency = data.agency; if ($agency.length <= 0) { $('.products .tabpage .tab li').eq(2).hide(); $('.products .tabpage .tab li').eq(0).click(); } else { $('.products .tabpage .tab li').eq(2).show(); } $parentArray = [1, 3, 6, 7, 8, 9]; inArray = false; for (i = 0; i < $parentArray.length; i++) { if (pid == $parentArray[i]) { inArray = true; break; } } if (inArray) { $('.products .tabpage .tab li').eq(2).find('a').text('鍚堜綔浼欎即'); } else { $('.products .tabpage .tab li').eq(2).find('a').text('浠g悊鍝佺墝'); } _agency = '
    '; $.each($agency, function (i, their) { _agency += '
    '; }); _agency += '
    '; $('.products .tabpage .pages').removeClass('fadeInRight animated').addClass('fadeOutLeft animated'); setTimeout(function () { $('.products .tabpage .pages').find('.type').html(_description); $('.products .tabpage .pages').find('.units').html(_operator); $('.products .tabpage .pages').find('.brands').html(_agency); $('.products .tabpage .pages').find('.capacity').html(_capacity); // 鏍稿績鑳藉姏 $('.products .tabpage .pages').find('.position').html(_position); // 琛屼笟鍦颁綅 $('.products .tabpage .pages').find('.entity').html(_entity); // 杩愯惀鍗曚綅 $('.products .tabpage .pages').find('.service').html(_service); // 浼樺娍鏈嶅姟 // 濡傛灉浼樺娍鏈嶅姟涓虹┖锛岄殣钘忚瀛楁 var ad_services_display = $service ? "block" : "none" $('.products .tabpage .pages').find('.service').css({"display": ad_services_display}); $('.products .tabpage .pages').find('.service').prev().css({"display": ad_services_display}); $('.products .tabpage .pages').removeClass('fadeOutLeft animated').addClass('fadeInRight animated'); basic.animated(); }, 300); }); } } var news = { mediaNews: function () { $('.mediaNews li').each(function (i) { if (i % 2 == 0) { $(this).addClass('leftmd'); } else { $(this).addClass('rightmd'); } if (i % 4 == 0 || (i + 1) % 4 == 0) { $(this).addClass('bg'); } }); }, companynews: function () { if ($(window).width() > 480) { $('.companyNews li').each(function (i) { if (i % 4 == 0 || (i + 1) % 4 == 0) { if (i % 4 == 0) { $(this).addClass('md4 leftmd'); } else { $(this).addClass('md4 rightmd'); } } else { $(this).addClass('md8'); } }); } } } var about = { response: function () { $('.response .block1 .tabpage .tabs li').eq(0).addClass('active'); $('.response .block1 .tabpage .pages dd').eq(0).addClass('active'); $('.response .tabpage .tabs li').on('click', function () { if ($(this).hasClass('active')) { // $(this).toggleClass('active'); $('.response .block1 .tabpage .pages').slideToggle(); } else { $(this).addClass('active').siblings().removeClass('active'); $index = $(this).index(); if (!$('.response .block1 .tabpage .pages').is(':visible')) { $('.response .block1 .tabpage .pages').slideDown(); } $('.response .block1 .tabpage .pages .page').eq($index).addClass('active').siblings().removeClass('active'); } }); $('.response .tabpage').on('click', '.slideUp', function () { $('.response .block1 .tabpage .pages').slideUp(); }) }, jsonRender: function (json_data) { $.each(json_data, function (i, data) { if ($(window).width() > 480) { _animateClass = 'reach="fadeInRight"'; } else { _animateClass = '' }; _animateClass = ''; $('.milestone .year').append('
  • ' + data.year + '
  • '); _temp = '
    ' + '
    ' + data.year + '
    '; $.each(data.data, function (n, date) { _temp += '

    ' + date.date + '

    ' + date.happend + '

    '; }); _temp += '
    '; $('.milestone .things').append(_temp); basic.animated(); }); }, milestone: function () { $('.milestone .year li').eq(0).addClass('active'); $('.milestone .things dl').eq(0).addClass('active'); // interact $('.milestone .year').on('click', 'li', function () { $(this).addClass('active').siblings().removeClass('active'); //while window's width > 768px do.. if (ww > 0) { index = $(this).index(); if (index > 0 && $('.milestone .year').scrollTop() > 0 && index - 2 <= $('.milestone .year').scrollTop() / $('.milestone .year li').outerHeight()) { $yearScroll = $('.milestone .year').scrollTop() - $('.milestone .year li').outerHeight() * 2; $('.milestone .year').animate({ scrollTop: $yearScroll }, 500); } else if (index < $('.milestone .year li').size() - 1 && $('.milestone .year').scrollTop() + $maxHeight < $('.milestone .year li').size() * $('.milestone .year li').outerHeight() && $('.milestone .year').scrollTop() / $('.milestone .year li').outerHeight() + 3 <= index) { $yearScroll = $('.milestone .year li').outerHeight() * 2 + $('.milestone .year').scrollTop(); $('.milestone .year').animate({ scrollTop: $yearScroll }, 500); } $year = $(this).text(); $offset = $('.milestone .things dl.year' + $year).offset().top - $('.milestone .things').offset().top + $('.milestone .things').scrollTop() - 30; $('.milestone .things').animate({ scrollTop: $offset }, 500); $('.milestone .things dl.year' + $year).addClass('active').siblings().removeClass('active'); } basic.animated(); // $('.milestone .things dl').niceScroll({ // cursorcolor:"#dadada", // background: '#fafafa', // cursorwidth: '5', // cursorborder:"#dadada", // cursorborderradius:"5", // cursoropacitymin: '0.5', // cursoropacitymax: '1', // horizrailenabled: false, // smoothscroll: false // }); }); // responce Init style if (ww > 0) { $maxHeight = $('.milestone .year li').outerHeight() * 6; $('.milestone .year , .milestone .things').css({ height: $maxHeight }); } }, gongsigaikuang: function () { $width = $('.gongsigaikuang .md4 .con').outerWidth(); $('.gongsigaikuang .md4 .con,.gongsigaikuang .md8 .con').css({ height: $width }); } } var index = { chain: function () { $('.index .supplychain .items').forslide({ step: 1, item: 'a', attr: 'eachdelay=".item" delaytime="100" ', callback: function () { $('.index .supplychain .items li').eq(0).addClass('active'); $size = $('.index .supplychain .items li').size(); for (i = 1; i <= $size; i++) { i == 1 ? $('.index .supplychain .pager ul').append('
  • ' + i + '
  • ') : $('.index .supplychain .pager ul').append('
  • ' + i + '
  • '); } } }); basic.animated(); canClick = true; $index_i = 0; $max = $('.index .supplychain .pager ul li').size() - 1; if ($index_i == 0 &&window.screen.width>768) { $timer = setInterval(function () { var v = document.getElementById('medio') v.currentTime = 0 v.play() $index_i += 1; $index_i > $max ? $index_i = 0 : null; $('.bannerarrows').find(".bx-next")[0].click(); }, 9000); } else { $timer = setInterval(function () { $index_i += 1; $index_i > $max ? $index_i = 0 : null; $('.bannerarrows').find(".bx-next")[0].click(); }, 4000); } // $timer = setInterval(function() { // $index_i+=1; // $index_i>$max ? $index_i = 0: null; // $('.index .supplychain .pager').find('li').eq($index_i).click(); // },4000); $('.index .supplychain .pager').on('click', 'li', function () { if (canClick) { clearInterval($timer); $current = $('.index .supplychain .pager li.active').index(); $eq = $(this).index(); $index_i = $eq; $(this).addClass('active').siblings().removeClass('active'); if ($eq > $current) { $('.index .supplychain .items li.active').find('.item').removeClass().addClass('item fadeOutLeft animated'); canClick = false; setTimeout(function () { $('.index .supplychain .items li.active').hide().removeClass('active'); $('.index .supplychain .items li').eq($eq).show().addClass('active').find('.item').removeClass().addClass('item fadeInRight animated'); setTimeout(function () { $('.index .banner .bx-controls').find('.bx-pager-item').eq($eq).find('a').click(); }, 100); canClick = true; if ($index_i == 0 &&window.screen.width>768) { var v = document.getElementById('medio') v.currentTime = 0 v.play() $timer = setInterval(function () { $index_i += 1; $index_i > $max ? $index_i = 0 : null; $('.index .supplychain .pager').find('li').eq($index_i).click(); }, 9000); } else { $timer = setInterval(function () { $index_i += 1; $index_i > $max ? $index_i = 0 : null; $('.index .supplychain .pager').find('li').eq($index_i).click(); }, 4000); } }, 600); } else if ($eq < $current) { $('.index .supplychain .items li.active').find('.item').removeClass().addClass('fadeOutRight animated item'); canClick = false; setTimeout(function () { $('.index .supplychain .items li.active').hide().removeClass('active'); $('.index .supplychain .items li').eq($eq).show().addClass('active').find('.item').removeClass().addClass('fadeInLeft animated item'); setTimeout(function () { $('.index .banner .bx-controls').find('.bx-pager-item').eq($eq).find('a').click(); }, 100); canClick = true; if ($index_i == 0 && window.screen.width>768) { var v = document.getElementById('medio') v.currentTime = 0 v.play() $timer = setInterval(function () { $index_i += 1; $index_i > $max ? $index_i = 0 : null; $('.index .supplychain .pager').find('li').eq($index_i).click(); }, 9000); } else { $timer = setInterval(function () { $index_i += 1; $index_i > $max ? $index_i = 0 : null; $('.index .supplychain .pager').find('li').eq($index_i).click(); }, 4000); } }, 600); } } }); }, banner: function () { if (ww > 768 || ww > 0) { var first = true; $('.index .bottom .trends .slides ul').forslide({ item: '.md4', pause: 5000, step: 3, clear: true, tagClass: 'row' }); $('.index .bottom .trends .slides ul').bxSlider({ pager: false, auto: true, prevSelector: $('.index .bottom .trends .arrows .prev'), nextSelector: $('.index .bottom .trends .arrows .next'), prevText: '', nextText: '' }); if (ww > 768) { if ($(window).height() >= 700) { $('.index .banner .slider li').css({ height: $(window).height() - $('.index .bottom').outerHeight() }); } else { $('.index .banner .slider li').css({ height: $(window).height() }); } $('.index .banner .slider li#zh_app_2023').remove(); } else { $('.index .banner .slider li').css({ height: $(window).height() - 50 }); $('.index .banner .slider li#first-v').remove(); $("[data-appsrc]").each(function (){ var that = $(this); var src = that.attr('data-appSrc'); that[0].style.backgroundImage = "url(" + src + ")"; }) } $sliderf = $('.index .banner .slider').bxSlider({ mode: 'fade', auto: false, pause: 8000, speed: 1000, touchEnabled: false, onSliderLoad: function () { $('.index .banner .slider li').eq(0).addClass('active'); $('.index .banner').find('.bx-controls .bx-pager-link').on('click',function (){ clearInterval($timer); $timer = setInterval(function () { $('.bannerarrows').find(".bx-next")[0].click(); }, 5000); }) if(!first){ const h1 = $('#zhSw').height(); const tp = $('#zhSw').offset().top; $('.index .banner').find('.bx-controls').css({ "height":h1+'px', "top":tp+'px' }) $('.index .banner').find('.bx-controls').addClass('active'); } }, onSlideAfter: function ($slideElement, oldIndex, newIndex) { if (newIndex === 1&&first&&window.screen.width>768){ first = false; $('.index .banner .slider li#first-v').remove(); $sliderf.reloadSlider(); }else{ $('.index .banner .slider li').removeClass('active').eq(newIndex).addClass('active'); } }, onSlideNext: function () { clearInterval($timer); $timer = setInterval(function () { $('.bannerarrows').find(".bx-next")[0].click(); }, 5000); }, onSlidePrev: function () { clearInterval($timer); $timer = setInterval(function () { $('.bannerarrows').find(".bx-next")[0].click(); }, 5000); }, prevSelector: $('.index .banner .bannerarrows .arrows .prev'), nextSelector: $('.index .banner .bannerarrows .arrows .next'), prevText: '', nextText: '' }); $('.index .banner .slider li').hide(); } } } var gobal = { active: function () { if (typeof (data_location) != 'undefined' && data_location != [] && data_location != '') { $top = data_location[0].nav_top; $left = data_location[0].nav_left; $leftsub = data_location[0].nav_left_sub; console.log($top) console.log($left) console.log($leftsub) $('.header .menu .menulist .list a').each(function () { if ($(this).text().indexOf($top) >= 0) { $(this).parent('li').addClass('active'); } else { $(this).parent('li').removeClass('active'); } }); $('.content .left dd>ul>li>a').each(function () { if ($(this).text().indexOf($left) >= 0) { $(this).parent('li').addClass('active'); } else { $(this).parent('li').removeClass('active'); } }); if ($leftsub != '') { $('.content .left dd li.active a').each(function () { if ($(this).text().indexOf($leftsub) >= 0) { $(this).parent('li').addClass('active'); } }); } } }, touchSwiper: function () { _current = $('.content .left>dl>dd>ul>.active').index(); gobal.switchMenu('null', _current); $('.content .left').swipe({ swipeStatus: function (event, direction, distance, duration, fingerCount, fingerData) { gobal.switchMenu(distance, duration, direction); } }); }, switchMenu: function (side, distance, e) { //if(side=='null') { if (side == 'null' && $('.content>.left>dl>dd>ul>li').eq(_current).size() > 0) { _offset = $('.content>.left>dl>dd>ul>li').eq(_current).offset().left - (ww - $('.content>.left>dl>dd>ul>li').eq(_current).outerWidth()) / 2; $('.content .left dd').animate({ scrollLeft: _offset }, 500); if ($('.content .left dd ul .active').find('.sub').size() > 0 && $(window).width() <= 1024) { _subMenu = []; $('.content .left dd ul .active .sub >li').each(function () { _subMenu.push($(this).prop('outerHTML')); }); $submenu = $(''); $.each(_subMenu, function (k, v) { $submenu.append(v); }); $('.content .left').append($submenu); $('.thr').each(function(){ $(this).siblings('a').attr('href',"###") }); $('.thr').parent('li').on('click',function(){ if(!$(this).hasClass('on')){ $(this).addClass('on') }else{ $(this).removeClass('on') } }); if($('li.active').parent('.thr').length != undefined){ $('li.active').parent('.thr').parent('li').addClass('on active'); } } } if (e == 'start') { _offset = $('.content .left dd').scrollLeft(); } else if (e == 'move') { if (side == 'left') { $('.content .left dd').finish(); $('.content .left dd').animate({ scrollLeft: _offset + distance }, 100); } if (side == 'right') { $('.content .left dd').finish(); $('.content .left dd').animate({ scrollLeft: _offset - distance }, 100); } } }, toggleMenu: function () { $('.menulist .list li').each(function () { $(this).addClass('fadeInUp animated'); }); $('.functions ul>li').each(function () { $(this).addClass('fadeInDown animated'); }); $('.menubtn').click(function () { if ($('.menulist').size() > 1) { if ($('.top .menulist').is(':visible')) { $('.top .menulist').removeClass('fadeInDown animated').addClass('fadeOutUp animated'); setTimeout(function () { $('.top .menulist').hide(); }, 300); } else { $('.top .menulist').show().removeClass('fadeOutUp animated').addClass('fadeInDown animated'); } } else { if ($('.menulist').is(':visible')) { $('.menulist').removeClass('fadeInDown animated').addClass('fadeOutUp animated'); setTimeout(function () { $('.menulist').hide(); }, 300); } else { $('.menulist').show().removeClass('fadeOutUp animated').addClass('fadeInDown animated'); } } }); $('body').click(function () { if ($('.menulist').size() > 1) { if ($('.top .menulist').is(':visible')) { $('.top .menulist').removeClass('fadeInDown animated').addClass('fadeOutUp animated'); setTimeout(function () { $('.top .menulist').hide(); }, 300); } else { if ($('.menulist').is(':visible')) { $('.menulist').removeClass('fadeInDown animated').addClass('fadeOutUp animated'); setTimeout(function () { $('.menulist').hide(); }, 300); } } } }); $('.header,.index .banner').click(function (e) { e.stopPropagation(); }); }, bookmark: function () { if ($('[mark]').size() > 1 && $(window).width() > 1180) { var _bookmark = []; $('[mark]').each(function () { var _this = {}; _this.labelName = $(this).text(); _this.targetMark = $(this).attr('mark'); _this.icon = $(this).siblings('.iconfont').html(); _bookmark.push(_this); }); // console.dir(_bookmark); $('.content .right').append(''); $.each(_bookmark, function (i, label) { $bookmark = $('.content .right .bookmark'); if ($('a[name=' + label.targetMark + ']').size() == 1) { $bookmark.append('
  • ' + label.icon + '' + label.labelName + '
  • '); } else if ($('a[name=' + label.targetMark + ']').size() > 1) { console.log('涔︾%c ' + label.targetMark + ' %c瀛樺湪澶氫釜閿氱偣锛岃繖浼氬鑷存粴鍔ㄤ綅缃嚭閿欙紝妫€鏌ユ嫾鍐欍€?, 'color:#fff; background: #f00;', ''); } else { console.log('涔︾%c ' + label.targetMark + ' %c涓嶅瓨鍦ㄥ尮閰嶇殑瀵瑰簲閿氱偣锛屾鏌ュ唴瀹广€?, 'color:#fff; background: #f00;', ''); } }); $('.bookmark').on('click', '[targetMark]', function () { targetMark = $(this).attr('targetMark'); $('html,body').animate({ scrollTop: $('a[name=' + targetMark + ']').offset().top - $('.menu').height() - 20 }, 666); }); $bookmarkTop = $('.bookmark').offset().top; $bookmarkLeft = $('.bookmark').offset().left; timeOut = ''; $(window).scroll(function () { clearInterval(timeOut); if ($(window).scrollTop() >= $bookmarkTop) { $('.bookmark').css({ position: 'fixed', left: $bookmarkLeft }); timeOut = setTimeout(function () { $('.bookmark').stop().animate({ top: $('.menu').height() }, 200); }, 100); } else { $('.bookmark').css({ position: 'absolute', top: 0, left: '100%' }); } }); } }, menufix: function () { if (scrollx >= _setting.menufixTriger && $(window).width() > 1024) { $('.header').addClass('ontop'); } else { $('.header').removeClass('ontop'); } }, terms: function () { $(window).keyup(function (e) { if (e.keyCode == '27') { $('.terms').fadeOut(); } }); $('.terms').click(function () { $(this).fadeOut(); }); $('.terms .win').click(function (e) { e.stopPropagation(); }); }, sitemap: function () { $(window).keyup(function (e) { if (e.keyCode == '27') { $('.sitemap').fadeOut(); } }); $('.sitemap').click(function () { $(this).fadeOut(); }); $('.sitemap .win').click(function (e) { e.stopPropagation(); }); } } /*鎸夋瘮渚嬪昂瀵?/ $.fn.ratio = function ($option) { var $setting = { scale: 3 / 4 } $.extend($setting, $option); var $obj = this; $width = parseInt($obj.width()); $height = $width * $setting.scale; $obj.css({ 'height': $height, 'overflow': 'hidden' }); } /*DOM鍒嗗壊*/ $.fn.forslide = function (_option) { _temp = ''; _html = ''; var _setting = { item: '.item', step: 4, tagName: 'li', tagClass: '', clear: false, attr: '', callback: function () { } } $.extend(_setting, _option); o = this; _size = o.find(_setting.item).size(); if (_setting.clear) { _clear = '
    '; } else { _clear = ''; } if (_size > _setting.step) { if (_size % _setting.step == 0) { for (_i = 0; _i < _size; _i++) { _temp += o.find(_setting.item + ':eq(' + _i + ')').prop('outerHTML'); if ((_i + 1) % _setting.step == 0) { _html += '<' + _setting.tagName + ' ' + _setting.attr + ' class="' + _setting.tagClass + '">' + _temp + _clear + ''; _temp = ''; } } } else { _page = Math.floor(_size / _setting.step); for (_i = 0; _i < _size; _i++) { _temp += o.find(_setting.item + ':eq(' + _i + ')').prop('outerHTML'); if ((_i + 1) % _setting.step == 0 && _i + 1 <= _page * _setting.step) { _html += '<' + _setting.tagName + ' ' + _setting.attr + ' class="' + _setting.tagClass + '">' + _temp + _clear + ''; _temp = ''; } } _html += '<' + _setting.tagName + ' ' + _setting.attr + ' class="' + _setting.tagClass + '">' + _temp + _clear + ''; } } else { _html += '<' + _setting.tagName + ' ' + _setting.attr + ' class="' + _setting.tagClass + '">' + o.html() + ''; } o.empty().append(_html); _setting.callback(); } var basic = { table: function () { $('table').each(function () { if ($(this).attr('responseTable')) { _attr = $(this).get(0).attributes; _class = $(this).attr('class'); _class ? null : _class = 'normal'; if ($(this).find('tr').eq(0).find('th').size() > 1) { side = 'shu'; isTable = true; } else if ($(this).find('tr').eq(0).find('th').size() == 1) { side = 'heng'; isTable = true; } else { isTable = false; } if (isTable && side == 'shu') { _ths = []; $(this).find('tr').eq(0).find('th').each(function () { _ths.push($(this).text()); }); _trs = []; $(this).find('tr').each(function (i) { _tds = []; if (i != 0) { $(this).find('td').each(function () { _tds.push($(this).text()); }); _trs.push(_tds); } }); // 鐢熸垚html $table = $('
    '); $tr = $('
    '); $.each(_ths, function (k, v) { $th = $('
    ').append($('' + v + '')); $tr.append($th); }); $table.append($tr); $.each(_trs, function (row, rowdata) { row++; $tr = $('
    '); $.each(rowdata, function (k, v) { $td = $('
    ').append($('' + _ths[k] + '')).append($('' + v + '')); $tr.append($td); }); $table.append($tr); }); $.each(_attr, function (k, v) { $table.attr(v.nodeName, v.value); }); $table.addClass('table hengTable'); $(this).replaceWith($table); } else if (isTable && side == 'heng') { _ths = []; _this = $(this); _trs = []; $(this).find('tr').each(function (i) { _trs[i] = []; _ths.push($(this).find('th').text()); $(this).find('td').each(function () { _trs[i].push($(this).text()); }); }); console.dir(_trs); //鐢熸垚html $table = $('
    '); $column = $('
    '); $.each(_ths, function (k, v) { columnNum = k + 1; $column.append($('
    ' + v + '
    ')); }); $table.append($column); $.each(_trs[0], function (k) { console.log(k); columnNum = k + 1; $column = $('
    '); $.each(_trs, function (row, data) { $column.append($('
    ' + _ths[row] + '' + data[k] + '
    ')); }); $table.append($column); }); $.each(_attr, function (k, v) { $table.attr(v.nodeName, v.value); }); $table.addClass('table shuTable'); $(this).replaceWith($table); } } }); }, lazyload: function () { $('[lazyload]').each(function () { if (!$(this).attr('src')) { $(this).css({ "background": "url(" + _setting.imgUrl + "bx_loader.gif) no-repeat center center" }); } if ($(this).offset().top - $(window).height() <= $(window).scrollTop()) { if (!$(this).attr('src')) { $(this).attr("src", $(this).attr("lazyload")); if (_setting.toggleImageSize) { var img_url = $(this).attr('src'); obj = $(this); var img = new Image(); img.src = img_url; var check = function () { if (img.width > 0 || img.height > 0) { obj.attr('data-width', img.width); obj.attr('data-height', img.height); clearInterval(set); } }; var set = setInterval(check, 40); } } } $(this).load(function () { $(this).css({ "background": "none" }); }); }); }, imgsize: function () { imgAmount = $('img[src]').size(); renderid = 0; loadnext = function (obj) { var img_url = obj.attr('src'); var img = new Image(); img.src = img_url; var check = function () { if (img.width > 0 || img.height > 0) { obj.attr('data-width', img.width); obj.attr('data-height', img.height); clearInterval(set); renderid++; renderid < imgAmount ? loadnext($('img').eq(renderid)) : null; } }; var set = setInterval(check, 40); } loadnext($('img').eq(renderid)); }, grids: function () { $css = []; $('.row').each(function () { mds = '.md1,.md2,.md3,.md4,.md5,.md6,.md7,.md8,.md9,.md10,.md11,.md12,.dv'; per = 100 / $(this).find('.dv').size(); $(this).find('.dv').css({ width: per + '%' }); $(this).find(mds).each(function () { $html = $(this).html(); $margin = $(this).css('margin'); $(this).addClass('mp0'); $(this).html('
    ' + $html + '
    '); if ($margin != '0px') { /*鑾峰彇鐖剁骇鐨勬墍鏈塩lass*/ $thisClass = '.' + $(this).attr('class').replace(/\s+/g, "."); $parent = $(this).parents('[class]'); $parentClass = []; if ($parent.attr('class')) { $parentClass.push($parent.attr('class').replace(/\s+/g, ".")); } for (i = 0; i < 5; i++) { $parent = $parent.parents('[class]'); if ($parent.attr('class')) { $parentClass.push($parent.attr('class').replace(/\s+/g, ".")); } } $parentClasses = ''; for (i = $parentClass.length - 1; i > 0; i--) { $parentClasses += '.' + $parentClass[i] + ' '; } $thisClassPath = $tcp = $parentClasses + $thisClass; $thisCss = $thisClassPath + ' .item {margin: ' + $margin + '}'; $css.push($thisCss); } }); }); /*鎻掑叆css鍒癶ead*/ $ncss = []; for (var i = 0; i < $css.length; i++) { var items = $css[i]; //鍒ゆ柇鍏冪礌鏄惁瀛樺湪浜巒ew_arr涓紝濡傛灉涓嶅瓨鍦ㄥ垯鎻掑叆鍒皀ew_arr鐨勬渶鍚 if ($.inArray(items, $ncss) == -1) { $ncss.push(items); } } $css = ''; for (i = 0; i < $ncss.length; i++) { $css += $ncss[i]; } $('').insertBefore('head'); }, deviceRotate: function () { if (mobile()) { window.addEventListener("onorientationchange" in window ? "orientationchange" : "resize", function () { // if (window.orientation === 180 || window.orientation === 0) { // $('body').addClass('vertical'); // } // if (window.orientation === 90 || window.orientation === -90 ){ // $('body').addClass('horizontal'); // } window.location.reload(true); }, false); } }, animated: function () { $('[firstactive]').each(function () { $tar = $(this).attr('firstactive'); $(this).find($($tar)).eq(0).addClass('active'); }); $('[prefix]').each(function () { $prefix = $(this).attr('prefix'); if ($(this).attr('child')) { $child = $(this).attr('child'); $(this).find($child).each(function (_i) { _i += 1; $(this).addClass($prefix).addClass($prefix + _i); }); } else { $(this).each(function (_i) { _i += 1; $(this).addClass($prefix).addClass($prefix + _i); }); } }); $('[split]').each(function () { _temp = []; _html = ''; if ($(this).attr('rendered') == 'true') { } else { $tar = $(this).attr('split'); $text = $(this).text(); for (i = 0; i < $text.length; i++) { _temp.push($text.substring(i, i + 1)); } for (i = 0; i < _temp.length; i++) { if (_temp[i] == "#") { _html += '
    '; } else { _html += '<' + $tar + '>' + _temp[i] + ''; } } $(this).html(_html); $(this).attr('rendered', 'true'); } }); $('[breakas]').each(function () { _temp = []; _text = []; _html = ''; typeof ($(this).attr('tagClass')) != 'undefined' ? _class = ' class="' + $(this).attr('tagClass') + '" ' : _class = ''; $tagName = $(this).attr('breakas'); $text = $(this).text(); _temp = $text.split('#'); $.each(_temp, function (k, v) { _text[k] = v.split(" "); }); console.dir(_text); $.each(_text, function (k, line) { $.each(line, function (a, word) { _html += '<' + $tagName + ' ' + _class + '>' + word + ' '; }); _html += '
    '; }); $(this).html(_html); }); $('[goto]').each(function () { $(this).on('click', function () { $tar = $(this).attr('goto'); $("html,body").animate({ scrollTop: $($tar).offset().top }, 1000); }); }); $('[vcenter]').each(function () { tar = $(this).attr('vcenter'); _html = $(this).find(tar).prop('outerHTML'); $(this).html('
    '); $(this).find('table').append('' + _html + ''); }); $('[absovcenter]').each(function () { $target = $(this).attr('absovcenter'); $position = $(this).css('position'); if ($position != 'absolute' && $position != 'relative' && $position != 'fixed') { $(this).css({ position: 'relative' }); } $targetHeight = $(this).find($target).outerHeight(); $(this).find($target).css({ position: 'absolute', top: '50%', marginTop: -$targetHeight / 2 }); }); $('[imgvcenter]').each(function () { tar = $(this).attr('imgvcenter'); outheight = $(this).height(); $(this).find(tar).load(function () { inheight = $(this).outerHeight(); $(this).css({ 'margin-top': (outheight - inheight) / 2 }); }); }); $('[eachdelay]').each(function () { delaytarget = $(this).attr('eachdelay'); delaytime = $(this).attr('delaytime') / 1000; if (typeof ($(this).attr('delaystart')) != 'undefined') { delay = parseInt($(this).attr('delaystart')) / 1000; } else { delay = 0; } $(this).find(delaytarget).each(function () { $(this).css({ 'animation-delay': delay + 's', '-webkit-animation-delay': delay + 's', '-o-animation-delay': delay + 's', '-moz-animation-delay': delay + 's' }); delay += delaytime; }); }); $('[hover]').each(function () { $(this).mouseenter(function () { animate = $(this).attr('hover'); if ($(this).attr("effect")) { effectchild = $(this).attr("effect"); $(this).find(effectchild).addClass(animate + " animated"); } else { $(this).addClass(animate + " animated"); } }); $(this).mouseleave(function () { animate = $(this).attr('hover'); if ($(this).attr("effect")) { effectchild = $(this).attr("effect"); $(this).find(effectchild).removeClass(animate + " animated"); } else { $(this).removeClass(animate + " animated"); } }); }); $('[animate]').each(function () { animate = $(this).attr('animate'); if (animate.indexOf(',') >= 0) { arr = animate.split(','); } else { arr = ["fadeIn", "zoomIn", "fadeInUp", "fadeInRight", "fadeInDown", "fadeInLeft"]; } $(this).attr('animateClass') ? animateClass = $(this).attr('animateClass') : animateClass = ''; if ($(this).attr('effect')) { if (animate == "random" || animate.indexOf(',') >= 0) { $(this).find($(this).attr('effect')).each(function () { random = Math.floor(Math.random() * (arr.length)); random = arr[random]; $(this).addClass(random + ' animated ' + animateClass); }); } else { $(this).find($(this).attr('effect')).addClass(animate + ' animated ' + animateClass); } } else { $(this).addClass(animate + ' animated ' + animateClass); } }); $('[reach]').each(function () { if ($(document).scrollTop() + $(window).height() >= $(this).offset().top) { animate = $(this).attr('reach'); $(this).attr('animateClass') ? animateClass = $(this).attr('animateClass') : animateClass = ''; if (animate.indexOf(',') >= 0) { arr = animate.split(','); } else { arr = ["fadeIn", "zoomIn", "fadeInUp", "fadeInRight", "fadeInDown", "fadeInLeft"]; } if ($(this).attr("effect")) { effectchild = $(this).attr("effect"); $(this).find(effectchild).each(function () { if (animate == "random" || animate.indexOf(',') >= 0) { random = Math.floor(Math.random() * (arr.length)); random = arr[random]; $(this).addClass(random + " animated " + animateClass); } else { $(this).addClass(animate + " animated " + animateClass); } }); $(this).find(effectchild).css({ 'visibility': 'visible' }); } else { $(this).addClass(animate + " animated " + animateClass); $(this).css({ 'visibility': 'visible' }); } // $(this).removeAttr('reach'); } }); $(window).scroll(function () { topval = $(document).scrollTop(); $('[reach]').each(function () { if (topval > $(this).offset().top - $(window).height()) { animate = $(this).attr('reach'); if ($(this).attr("effect")) { effectchild = $(this).attr("effect"); $(this).find(effectchild).addClass(animate + " animated"); $(this).find(effectchild).css({ 'visibility': 'visible' }); } else { $(this).addClass(animate + " animated"); $(this).css({ 'visibility': 'visible' }); } } else { animate = $(this).attr('reach'); if ($(this).attr("effect")) { effectchild = $(this).attr("effect"); $(this).find(effectchild).removeClass(animate + " animated"); $(this).find(effectchild).css({ 'visibility': 'hidden' }); } else { $(this).removeClass(animate + " animated"); $(this).css({ 'visibility': 'hidden' }); } } }); }); } } function dir(e) { console.dir(e); } function log(e) { console.log(e); } function version() { var explorer = window.navigator.userAgent; if (explorer.indexOf("MSIE") >= 0 || explorer.indexOf("Trident") > 0) { if (explorer.indexOf("MSIE 5") > 0 || explorer.indexOf("MSIE 6") > 0 || explorer.indexOf("MSIE 7") > 0 || explorer.indexOf("MSIE 8") > 0) { return 'LowerIEVersion'; } else { return 'EdgeOrTrident'; } } else if (explorer.indexOf("Maxthon") >= 0) { return 'Maxthon'; } else if (explorer.indexOf("Firefox") >= 0) { return 'FireFox'; } else if (explorer.indexOf("Chrome") >= 0) { return 'Chrome'; } else if (explorer.indexOf("Opera") >= 0) { return 'Opera'; } else if (explorer.indexOf("Safari") >= 0) { return 'Safari'; } } function mobile() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = false; for (var v = 0; v < Agents.length; v++) { if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = true; break; } } // var isAndroid = userAgentInfo.indexOf('Android') > -1; // var isiOS = !!userAgentInfo.match(/(\(i[^;]+;( U;)? CPU.+Mac OS X)|renrenche/); return flag; } function mousewheel() { $('body').append(repeat('
    ', 200)); $('body').mousewheel(function (event, delta) { log(delta); }); } function nicescroll() { $('body').niceScroll({ cursorcolor: "none", background: 'none', cursorwidth: '5', cursorborder: "none", cursorborderradius: "0", cursoropacitymin: '0.5', cursoropacitymax: '1', horizrailenabled: false, smoothscroll: false }); } function banscroll() { if ($('body').hasClass('banscroll')) { $('body').getNiceScroll(0).locked = true; } else { $('body').getNiceScroll(0).locked = false; } } function limit(text, length, overflow) { if (!overflow) { overflow = '...'; } if (!length) { length = 10; } return text.substr(0, length) + overflow; } function repeat(text, x) { var $temp = []; x |= 1; for (var i = 0; i <= x; $temp[i++] = ''); return $temp.join(text); } var $template = { render: function (tpl, data) { var temp = []; for (var i = 0; i < data.length; i++) { temp.push($template.htmlTemplate(tpl, data[i])); } return temp.join(""); }, htmlTemplate: function (template, data, allowEmpty, chats) { var regExp; chats = chats || ['\\$\\{', '\\}']; regExp = [chats[0], '([_\\w]+[\\w\\d_]?)', chats[1]].join(''); regExp = new RegExp(regExp, 'g'); return template.replace(regExp, function (s, s1) { if (data[s1] != null && data[s1] != undefined) { return data[s1]; } else { return allowEmpty ? '' : s; } }); } } var $cookie = { set: function (c_name, value, expiredays) { var exdate = new Date() exdate.setDate(exdate.getDate() + expiredays) document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()) }, get: function (c_name) { if (document.cookie.length > 0) { c_start = document.cookie.indexOf(c_name + "=") if (c_start != -1) { c_start = c_start + c_name.length + 1 c_end = document.cookie.indexOf(";", c_start) if (c_end == -1) { c_end = document.cookie.length } return unescape(document.cookie.substring(c_start, c_end)) } } return false; } } function ChangeCountry(Countryname) { if (Countryname != '') { $.post('network.html', { getprovince: 1, Countryname: Countryname }, function (data, textStatus) { if (textStatus == "success") { //$("#kprovince").val==''; $("#province").html(data); $("#city").html(''); } }); } else { $("#province").html(''); $("#city").html(''); } } function ChangeProvince(Provincename) { if (Provincename != '') { $.post('network.html', { getcity: 1, Provincename: Provincename }, function (data, textStatus) { if (textStatus == "success") { $("#city").val == ''; $("#city").html(data); } }); } else { $("#city").html(''); } } $().ready(function () { $("input,textarea").keydown(function () { $("#respond").html(""); }); //$("input,textarea").keydown(function(){$(this).removeClass("no");}); $("#feedback_btn").click(function () { if ($("#allowed").val() != 1) { return false; } $("#allowed").val(0); //$("#respond").html("鐣欒█鎻愪氦涓?.."); var title = $('#title').val(), tel = $('#tel').val(), contact_name = $('#contact_name').val(), email = $('#email').val(), message = $('#message').val(), salt = $('#salt').val(); $.post('question.html', { feedback: 1, title: title, tel: tel, contact_name: contact_name, email: email, message: message, salt: salt }, function (data, textStatus) { if (textStatus == "success") { if (data['success'] == 1) { $("#title").removeClass("no"); $("#tel").removeClass("no"); $("#message").removeClass("no"); $("#respond").html("鎮ㄧ殑鐣欒█鎴戜滑宸叉敹鍒?); $(':input').not(':hidden,:button').val(''); $("#allowed").val(1); } else { if (data['title'] == 1) { $("#title_area").addClass("no"); } else { $("#title_area").removeClass("no"); } if (data['tel'] == 1) { $("#tel_area").addClass("no"); } else { $("#tel_area").removeClass("no"); } if (data['contact_name'] == 1) { $("#contact_name_area").addClass("no"); } else { $("#contact_name_area").removeClass("no"); } if (data['email'] == 1) { $("#email_area").addClass("no"); } else { $("#email_area").removeClass("no"); } if (data['message'] == 1) { $("#message_area").addClass("no"); } else { $("#message_area").removeClass("no"); } //$("#respond").html("璇烽噸鏂拌緭鍏?); $("#allowed").val(1); } return false; } }, 'json'); }); if($(window).width() > 1024){ console.log('dang') if($('li.active').parent('.thr').length != undefined){ $('li.active').parent('.thr').parent('li').addClass('on'); } } }); function wxShare() { wx.onMenuShareAppMessage({ title: _share, desc: _desc, link: _link, imgUrl: _imgUrl, success: function (res) { shareSuccess(); }, fail: function (res) { //alert(_shareErr); } }); wx.onMenuShareTimeline({ title: _share, link: _link, imgUrl: _imgUrl, success: function (res) { shareSuccess(); }, fail: function (res) { //alert(_shareErr); } }); wx.onMenuShareQQ({ title: _share, desc: _desc, link: _link, imgUrl: _imgUrl, success: function (res) { shareSuccess(); }, fail: function (res) { //alert(_shareErr); } }); wx.onMenuShareWeibo({ title: _share, desc: _desc, link: _link, imgUrl: _imgUrl, success: function (res) { shareSuccess(); }, fail: function (res) { //alert(_shareErr); } }); } // (鍏ㄥ眬)涓嬫媺鏃剁粰宸︿晶瀵艰埅澧炲姞鍥哄畾鏁堟灉 $(function () { $(window).resize(function() { console.log('鎷栧姩绐楀彛') let logoLeft = $('.logo').offset().left; if ($('.content').offset().top - $(window).scrollTop() - 60 <= 0 ) { $('.left').css({ position:'fixed', left:logoLeft + 'px', top:'60px' }) } }); if($(window).width() >= 1024){ $(window).scroll(function () { if ($('.content').offset().top - $(window).scrollTop() - 60 <= 0 ) { if(! $('.left').hasClass('on')){ $('.left').addClass('on'); let lLeft = $('.content').offset().left; $('.left').css({ position:'fixed', left:lLeft + 'px', top:'60px' }) } } else { $('.left').removeClass('on'); $('.left').css({ position:'absolute', left:'0', top:'0' }) } }); } })