var Ip="http://172.168.30.249:28013/"; //var Ip='http://pre.gw.youanmi.com/';//璐墿鍏洯鍦板潃 /*http://192.168.1.70:8081*/ //IE8涓嶅吋瀹筩onsole window.console = window.console || (function(){ var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile = c.clear = c.exception = c.trace = c.assert = function(){}; return c; })(); $(function(){ //澧炲姞鐗堟湰鍙 $("body").find('.logo').attr('title','V1.0.0'); /*navbar*/ // console.log('20160708_1900'); var hasHover = null; var old = null; $(".navbar>li").hover(function(){ if($(this).find('ul').length){ if($(this).hasClass('active')){ hasHover = 1; } $(this).removeClass('active').addClass('actives'); $(this).find('ul').show(); }else{ if($(this).hasClass('active')){ old = 1; } $(this).addClass('active'); } },function(){ if(hasHover!=null){ if($(this).find('ul').length){ $(this).removeClass('actives').addClass('active'); } }else{ if(old!=null){ $(this).attr('class','active'); }else{ $(this).attr('class',''); } } $(this).find('ul').hide(); hasHover = null; old = null; }); $('.del').click(function(event) { $(this).parents('.qq_r').hide(); $('.qq_sou').show(); }); $('.qq_sou').click(function(){ $('this').hide(); $('.qq_r').show(); }) /*鎴戣鍜ㄨ灞曞紑鏀剁缉*/ $(".question-wrap").on('click','.unfolded-div',function(){ var unfolded = $(this).find('.unfolded'); var isreduce = (unfolded.html() == '-'); var nextDiv = $(this).next(); var ishide = (nextDiv.css('display') == 'block'); $(".question-wrap .unfolded-text").hide(); $(".question-wrap .unfolded-div").each(function(){ $(this).find('.unfolded').html('+'); }); var rowid = $(this).attr('rowid'); if(isreduce && ishide){ nextDiv.hide(); unfolded.html('+'); }else{ nextDiv.show(); unfolded.html('-'); $.ajax({ type: "GET", url: Ip+'/gw/faq/detail', dataType: 'json', timeout: 10000, data: { id: rowid }, success: function (response) { } }); } }); //娓犻亾鍚堜綔 $(".service-select>span").hover(function(){ var index_this = $(this).index(); $(".service-select>span").removeClass('actived').eq(index_this).addClass('actived'); $(".service-selected>div").hide().eq(index_this).show(); }); //棣栭〉棰滆壊鍧桯over $(".solutions>div").hover(function(){ var index_this = $(this).index(); $(".point-span").hide(); $(".solutions-content>div").hide().eq(index_this).show(); $(".solutions>div").eq(index_this).find('.point-span').show(); }); }); //鏃堕棿杞崲 function addZero(m){return m<10?'0'+m:m } function format(data,type){ var times = new Date(data); var y = times.getFullYear(); var m = times.getMonth()+1; var d = times.getDate(); var hour = times.getHours(); var minute = times.getMinutes(); if(type == undefined){ return y+'.'+addZero(m)+'.'+addZero(d); }else{ return y+'.'+addZero(m)+'.'+addZero(d)+' '+addZero(hour)+':'+addZero(minute); } } //鑾峰彇url鍙傛暟 function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } //榧犳爣缁忚繃棰勮鍥剧墖鍑芥暟 function preview(img){ $("#preview .jqzoom img").attr("src",$(img).attr("src")); $("#preview .jqzoom img").attr("jqimg",$(img).attr("bimg")); } function pic(){ //鍥剧墖棰勮灏忓浘绉诲姩鏁堟灉,椤甸潰鍔犺浇鏃惰Е鍙 var tempLength = 0; //涓存椂鍙橀噺,褰撳墠绉诲姩鐨勯暱搴 var viewNum = 5; //璁剧疆姣忔鏄剧ず鍥剧墖鐨勪釜鏁伴噺 var moveNum = 2; //姣忔绉诲姩鐨勬暟閲 var moveTime = 300; //绉诲姩閫熷害,姣 var scrollDiv = $(".spec-scroll .items ul"); //杩涜绉诲姩鍔ㄧ敾鐨勫鍣 var scrollItems = $(".spec-scroll .items ul li"); //绉诲姩瀹瑰櫒閲岀殑闆嗗悎 var moveLength = scrollItems.eq(0).width() * moveNum; //璁$畻姣忔绉诲姩鐨勯暱搴 var countLength = (scrollItems.length - viewNum) * scrollItems.eq(0).width(); //璁$畻鎬婚暱搴?鎬讳釜鏁?鍗曚釜闀垮害 //涓嬩竴寮 $(".commentary").on("click",'.next',function(){ if(tempLength < countLength){ if((countLength - tempLength) > moveLength){ scrollDiv.animate({left:"-=" + moveLength + "px"}, moveTime); tempLength += moveLength; }else{ scrollDiv.animate({left:"-=" + (countLength - tempLength) + "px"}, moveTime); tempLength += (countLength - tempLength); } } }); //涓婁竴寮 $(".commentary").on("click",'.prev',function(){ if(tempLength > 0){ if(tempLength > moveLength){ scrollDiv.animate({left: "+=" + moveLength + "px"}, moveTime); tempLength -= moveLength; }else{ scrollDiv.animate({left: "+=" + tempLength + "px"}, moveTime); tempLength = 0; } } }); //鍥剧墖鏀惧ぇ闀滄晥鏋 //$(".jqzoom").jqueryzoom({xzoom:380,yzoom:410}); } (function($) { //鍒嗛〉鎻掍欢 var ms = { init:function(obj,args){ return (function(){ ms.fillHtml(obj,args); ms.bindEvent(obj,args); })(); }, //濉厖html fillHtml:function(obj,args){ return (function(){ obj.empty(); //涓婁竴椤 if(args.current > 1){ obj.append('涓婁竴椤袋/a>'); }else{ obj.remove('.prevPage'); obj.append('涓婁竴椤袋/span>'); } //涓棿椤电爜 if(args.current != 1 && args.current >= 4 && args.pageCount != 4){ obj.append(''+1+''); } if(args.current-2 > 2 && args.current <= args.pageCount && args.pageCount > 5){ obj.append('...'); } var start = args.current -2,end = args.current+2; if((start > 1 && args.current < 4)||args.current == 1){ end++; } if(args.current > args.pageCount-4 && args.current >= args.pageCount){ start--; } for (;start <= end; start++) { if(start <= args.pageCount && start >= 1){ if(start != args.current){ obj.append(''+ start +''); }else{ obj.append(''+ start +''); } } } if(args.current + 2 < args.pageCount - 1 && args.current >= 1 && args.pageCount > 5){ obj.append('...'); } if(args.current != args.pageCount && args.current < args.pageCount -2 && args.pageCount != 4){ obj.append(''+args.pageCount+''); } //涓嬩竴椤 if(args.current < args.pageCount){ obj.append('涓嬩竴椤袋/a>'); }else{ obj.remove('.nextPage'); obj.append('涓嬩竴椤袋/span>'); } })(); }, //缁戝畾浜嬩欢 bindEvent:function(obj,args){ return (function(){ obj.on("click","a.tcdNumber",function(){ var current = parseInt($(this).text()); ms.fillHtml(obj,{"current":current,"pageCount":args.pageCount}); if(typeof(args.backFn)=="function"){ args.backFn(current); } }); //涓婁竴椤 obj.on("click","a.prevPage",function(){ var current = parseInt(obj.children("span.current").text()); ms.fillHtml(obj,{"current":current-1,"pageCount":args.pageCount}); if(typeof(args.backFn)=="function"){ args.backFn(current-1); } }); //涓嬩竴椤 obj.on("click","a.nextPage",function(){ var current = parseInt(obj.children("span.current").text()); ms.fillHtml(obj,{"current":current+1,"pageCount":args.pageCount}); if(typeof(args.backFn)=="function"){ args.backFn(current+1); } }); })(); } } $.fn.createPage = function(options){ var args = $.extend({ pageCount : 10, current : 1, backFn : function(){} },options); ms.init(this,args); } /*棣栭〉杞挱鍥?/ $.fn.slideBox = function(options) { //榛樿鍙傛暟 var defaults = { direction : 'left',//left,top duration : 0.6,//unit:seconds easing : 'swing',//swing,linear delay : 3,//unit:seconds startIndex : 0, hideClickBar : true, clickBarRadius : 5,//unit:px hideBottomBar : false, width : null, height : null }; var settings = $.extend(defaults, options || {}); //璁$畻鐩稿叧鏁版嵁 var wrapper = $(this), ul = wrapper.children('ul.items'), lis = ul.find('li'), firstPic = lis.first().find('img'); var li_num = lis.size(), li_height = 0, li_width = 0; //瀹氫箟婊氬姩椤哄簭:ASC/DESC.ADD.JENA.201208081718 var order_by = 'ASC'; //鍒濆鍖 var init = function(){ if(!wrapper.size()) return false; //鎵嬪姩璁惧畾鍊间紭鍏?ADD.JENA.201303141309 //li_height = settings.height ? settings.height : lis.first().height(); li_height = '460'; li_width = $(".container").width(); //li_width = settings.width ? settings.width : lis.first().width(); wrapper.css({width: li_width+'px', height:li_height+'px'}); lis.css({width: li_width+'px', height:li_height+'px'});//ADD.JENA.201207051027 if (settings.direction == 'left') { ul.css('width', li_num * li_width + 'px'); } else { ul.css('height', li_num * li_height + 'px'); } ul.find('li:eq('+settings.startIndex+')').addClass('active'); if(!settings.hideBottomBar){//ADD.JENA.201208090859 var tips = $('
').css('opacity', 1).appendTo(wrapper); var title = $('
').html(function(){ var active = ul.find('li.active').find('a'), text = active.attr('title'), href = active.attr('href'); return $('
').attr('href', href).text(text); }).appendTo(tips); var nums = $('
').hide().appendTo(tips); lis.each(function(i, n) { var a = $(n).find('a'), text = a.attr('title'), href = a.attr('href'), css = ''; i == settings.startIndex && (css = 'active'); $('
').attr('href', href).text(text).addClass(css).css('borderRadius', settings.clickBarRadius+'px').mouseover(function(){ $(this).addClass('active').siblings().removeClass('active'); ul.find('li:eq('+$(this).index()+')').addClass('active').siblings().removeClass('active'); start(); stop(); }).appendTo(nums); }); if(settings.hideClickBar){//ADD.JENA.201206300847 tips.hover(function(){ nums.animate({top: '0px'}, 'fast'); }, function(){ nums.animate({top: tips.height()+'px'}, 'fast'); }); nums.show().delay(2000).animate({top: tips.height()+'px'}, 'fast'); }else{ nums.show(); } } lis.size()>1 && start(); } //寮€濮嬭疆鎾 var start = function() { var active = ul.find('li.active'), active_a = active.find('a'); var index = active.index(); if(settings.direction == 'left'){ offset = index * li_width * -1; param = {'left':offset + 'px' }; }else{ offset = index * li_height * -1; param = {'top':offset + 'px' }; } wrapper.find('.nums').find('a:eq('+index+')').addClass('active').siblings().removeClass('active'); wrapper.find('.title').find('a').attr('href', active_a.attr('href')).text(active_a.attr('title')); ul.stop().animate(param, settings.duration*1000, settings.easing, function() { active.removeClass('active'); if(order_by=='ASC'){ if (active.next().size()){ active.next().addClass('active'); }else{ order_by = 'DESC'; active.prev().addClass('active'); } }else if(order_by=='DESC'){ if (active.prev().size()){ active.prev().addClass('active'); }else{ order_by = 'ASC'; active.next().addClass('active'); } } }); wrapper.data('timeid', window.setTimeout(start, settings.delay*1000)); }; //鍋滄杞挱 var stop = function() { window.clearTimeout(wrapper.data('timeid')); }; //榧犳爣缁忚繃浜嬩欢 wrapper.hover(function(){ stop(); }, function(){ wrapper.data('timeid', window.setTimeout(start, settings.delay*1000)) }); //棣栧紶鍥剧墖鍔犺浇瀹屾瘯鍚庢墽琛屽垵濮嬪寲 var imgLoader = new Image(); imgLoader.onload = function(){ imgLoader.onload = null; init(); } imgLoader.src = firstPic.attr('src'); }; })(jQuery); function banner(){ var bn_id = 0; var bn_id2= 1; var speed33=5000; var qhjg = 1; var MyMar33; $("#banner .d1").hide(); $("#banner .d1").eq(0).fadeIn("slow"); if($("#banner .d1").length>1) { $("#banner_id li").eq(0).addClass("nuw"); function Marquee33(){ bn_id2 = bn_id+1; if(bn_id2>$("#banner .d1").length-1) { bn_id2 = 0; } $("#banner .d1").eq(bn_id).css("z-index","2"); $("#banner .d1").eq(bn_id2).css("z-index","1"); $("#banner .d1").eq(bn_id2).show(); $("#banner .d1").eq(bn_id).fadeOut("slow"); $("#banner_id li").removeClass("nuw"); $("#banner_id li").eq(bn_id2).addClass("nuw"); bn_id=bn_id2; }; MyMar33=setInterval(Marquee33,speed33); $("#banner_id li").click(function(){ var bn_id3 = $("#banner_id li").index(this); if(bn_id3!=bn_id&&qhjg==1) { qhjg = 0; $("#banner .d1").eq(bn_id).css("z-index","2"); $("#banner .d1").eq(bn_id3).css("z-index","1"); $("#banner .d1").eq(bn_id3).show(); $("#banner .d1").eq(bn_id).fadeOut("slow",function(){qhjg = 1;}); $("#banner_id li").removeClass("nuw"); $("#banner_id li").eq(bn_id3).addClass("nuw"); bn_id=bn_id3; } }) $("#banner_id").hover( function(){ clearInterval(MyMar33); } , function(){ MyMar33=setInterval(Marquee33,speed33); } ) } else { $("#banner_id").hide(); } } $(function(){ $(function(){ var top = document.documentElement.scrollTop || document.body.scrollTop; var toTop = $('#toTop') top>300 ? toTop.show() : toTop.hide() }) window.onscroll = function(){ var top = document.documentElement.scrollTop || document.body.scrollTop; var toTop = $('#toTop') if(top>300){ toTop.show() }else{ toTop.hide() } } $('#toTop').on('click', function(){ var top = document.documentElement.scrollTop || document.body.scrollTop; goTop(top, 300) }) function goTop(top, time){ var time = time||500; var step = top/time * 10 var time1 = 0; time1 = setInterval(function(){ if(top