$('body').ready(function() { var timerId = null function activeCommonTwoItem(ele) { var period = 5000 $('.commonTwo-type-item').removeClass('commonTwo-type-item--on') $(ele).addClass('commonTwo-type-item--on') var index = $('.commonTwo-type-item').index(ele) $('.commonTwo-show-image').hide() $('.commonTwo-show-image:eq(' + index + ')').show() $('.commonTwo-type-item').not(ele).find('.progress').css({ width: 0 }).stop() $(ele).find('.progress').animate({ width: '100%' }, period) timerId = setTimeout(function() { var nextEle = null if (index === $('.commonTwo-type-item').length - 1) { nextEle = $('.commonTwo-type-item:eq(0)') } else { nextEle = $('.commonTwo-type-item:eq(' + (index + 1) + ')') } activeCommonTwoItem(nextEle) }, period) } $('.commonTwo-type-item').click(function(e, i) { //做成了hover效果 clearTimeout(timerId) activeCommonTwoItem(this) }) activeCommonTwoItem($('.commonTwo-type-item:eq(0)')) var timerId = null function activeCommonTwoItema(ele) { var period = 5000 $('.commonTwo-type-itema').removeClass('commonTwo-type-itema--on') $(ele).addClass('commonTwo-type-itema--on') var index = $('.commonTwo-type-itema').index(ele) $('.commonTwo-show-imagea').hide() $('.commonTwo-show-imagea:eq(' + index + ')').show() $('.commonTwo-type-itema').not(ele).find('.progress').css({ width: 0 }).stop() $(ele).find('.progress').animate({ width: '100%' }, period) timerId = setTimeout(function() { var nextEle = null if (index === $('.commonTwo-type-itema').length - 1) { nextEle = $('.commonTwo-type-itema:eq(0)') } else { nextEle = $('.commonTwo-type-itema:eq(' + (index + 1) + ')') } activeCommonTwoItema(nextEle) }, period) } $('.commonTwo-type-itema').click(function(e, i) { //做成了hover效果 clearTimeout(timerId) activeCommonTwoItema(this) }) activeCommonTwoItema($('.commonTwo-type-itema:eq(0)')) var timerId = null function activeCommonTwoItemb(ele) { var period = 5000 $('.commonTwo-type-itemb').removeClass('commonTwo-type-itemb--on') $(ele).addClass('commonTwo-type-itemb--on') var index = $('.commonTwo-type-itemb').index(ele) $('.commonTwo-show-imageb').hide() $('.commonTwo-show-imageb:eq(' + index + ')').show() $('.commonTwo-type-itemb').not(ele).find('.progress').css({ width: 0 }).stop() $(ele).find('.progress').animate({ width: '100%' }, period) timerId = setTimeout(function() { var nextEle = null if (index === $('.commonTwo-type-itemb').length - 1) { nextEle = $('.commonTwo-type-itemb:eq(0)') } else { nextEle = $('.commonTwo-type-itemb:eq(' + (index + 1) + ')') } activeCommonTwoItemb(nextEle) }, period) } $('.commonTwo-type-itemb').click(function(e, i) { //做成了hover效果 clearTimeout(timerId) activeCommonTwoItemb(this) }) activeCommonTwoItemb($('.commonTwo-type-itemb:eq(0)')) // if (jQuery(".index_banner").length) { // jQuery('.index_banner').slide({ // titCell: '.hd ul', // mainCell: '.bd ul', // effect: 'fold', // autoPlay: true, // autoPage: true, // trigger: 'click', // delayTime: 3000, // interTime: 7000 // }) // } // 导航栏 var map = { textin_scene: 'ai', textin_contract: 'ai', textin_image: 'ai', textin_financia: 'ai', textin_text: 'ai', textin_ai_platform: 'ai', textin_studio: 'ai', textin_studio_pro: 'ai', database: 'bigdata', api: 'bigdata', qxb: 'bigdata', standardization: 'bigdata', customization: 'bigdata', bankcard: 'solution', securities: 'solution', insurance: 'solution', government: 'solution', supply_chains: 'solution', mobile_internet: 'solution', saas: 'solution', other_ecological: 'solution', env: 'solution', finance: 'solution', bank: 'solution', 'personal-camcard': 'star', 'personal-camscanner': 'star', qx_huiyan:'star', camcardbusiness: 'star', qixinbao_new: 'star', about: 'hehe', contactus: 'hehe', recruit: 'hehe' } var file = '' var res = '' if (!String.prototype.includes) { String.prototype.includes = function(search, start) { if (typeof start !== 'number') { start = 0; } if (start + search.length > this.length) { return false; } else { return this.indexOf(search, start) !== -1; } }; } if (!window.location.pathname.includes('shtml')) { file = window.location.pathname.split('/') res = file[file.length - 1] } else { file = window.location.pathname.split('/') res = file[file.length - 1].split('.')[0] } $('.nav-item').removeClass('nav-item--on') if (window.location.pathname === '/solution/index.shtml') { $('#solutionNav').addClass('nav-item--on') } else if (res) { $('#' + map[res] + 'Nav').addClass('nav-item--on') } else { $('#homeNav').addClass('nav-item--on') } var navH=$("#header").offset().top; $(window).scroll(function(){ // 固定导航 if($(document).scrollTop()>navH){ $("#header").removeClass("header-old") $("#header").addClass("head-active") }else{ $("#header").removeClass("head-active") $("#header").addClass("header-old") } }) // 返回顶部 $('.return-top').click(function() { document.body.scrollTop = 0; $('html').animate({ scrollTop: 0 }, 300) }) // 锚点 if($(".anchor").length){ // console.log("6666",$(".anchor").length) $(".anchor").smartFloat(); $('.anchor-item a').click(function() { console.log("oooo") var id = $(this).attr('data') var agent = navigator.userAgent.toLowerCase() var offsetTop = $('#' + id).attr('offsetTop') // var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop; if (agent.indexOf("windows") >= 0) { // 目前仅有windows会出现自动放大的情况 offsetTop = offsetTop * 1 / window.devicePixelRatio } console.log("scrolltop", offsetTop) $('html,body').animate({ scrollTop: offsetTop - 200 }, 300) }) } // 兼容windows自推荐150%放大 var agent = navigator.userAgent.toLowerCase() if (agent.indexOf("windows") >= 0) { // 目前仅有windows会出现自动放大的情况 correctDevicePixeRatio() window.onresize = correctDevicePixeRatio } function correctDevicePixeRatio() { $('body').css({ 'zoom': 1 / window.devicePixelRatio }) } })