$(function () { /*阻止浏览器的默认行为*/ function stopDefault(e) { (e && e.preventDefault) ? e.preventDefault() : window.event.returnValue = false; }; /*去除链接的虚线框*/ $('a').on('focus', function () { $(this).blur(); }); $('#banner').gradient(); var page_width = 0; $(".page_class li").each(function () { page_width += $(this).outerWidth(true); }) $(".page_class").css("width", page_width); /*input-text*/ $('.input-text').focus(function () { $(this).siblings('label').addClass('hide'); }).blur(function () { if ($(this).val() == '') { $(this).siblings('label').removeClass('hide'); }; }); var mouseover = $('.mouseover'); if (mouseover.length) { mouseover.each(function () { $(this).on('mouseover', 'li', function () { $(this).addClass('curr').siblings().removeClass('curr'); }); }); }; var inSolutions = $('#inSolutions'), liIndex = 0, liTimeId = null; if (inSolutions.length) { //inSolutions.find('li').each(function(i) { // $(this).css({ // position: 'absolute', // top: 0, // left: i * 108 + 137 + 'px' // }); //}).first().css({left: 0,width:'244px'}); //inSolutions.find('li').on('mouseover', function() { // clearTimeout(liTimeId); // var _this = $(this), // index = _this.index(); // liTimeId = setTimeout(function () { // slideLeft(index); // },50) //}); }; function slideLeft (index) { if (liIndex > index) { for (; index < liIndex; liIndex--) { inSolutions.find('li').eq(liIndex).animate({left:'+=137px',width:'107px'}, 300); console.log(liIndex) }; inSolutions.find('li').eq(liIndex).animate({width:'244px'}, 300); }; if (liIndex < index) { inSolutions.find('li').eq(liIndex).animate({width:'107px'}, 300); liIndex++; for (; liIndex < index; liIndex++) { inSolutions.find('li').eq(liIndex).animate({left:'-=137px',width:'107px'}, 300); }; inSolutions.find('li').eq(liIndex).animate({left:'-=137px',width:'244px'}, 300); }; liIndex = index; } var $product_tab = $(".tab-box") $product_tab.each(function () { var _this = $(this); var $title = _this.find(".title"); $title.find("li:eq(0)").addClass("current"); var $content = _this.find(".content"); $title.find("li").click(function () { if ($(this).hasClass('no')) {return}; var index = $(this).index(); $title.find("li").removeClass("current"); $content.hide(); $(this).addClass("current").siblings().removeClass("current"); $content.eq(index).show(); }) }) var $product_tab2 = $(".tab-box2") $product_tab2.each(function () { var _this = $(this); var $title = _this.find(".title2"); $title.find("li:eq(0)").addClass("current"); var $content = _this.find(".content2"); $title.find("li").click(function () { if ($(this).hasClass('no')) { return }; var index = $(this).index(); $title.find("li").removeClass("current"); $content.hide(); $(this).addClass("current").siblings().removeClass("current"); $content.eq(index).show(); }) }) var $product_tab3 = $(".tab-box3") $product_tab3.each(function () { var _this = $(this); var $title = _this.find(".title3"); var $content = _this.find(".content3"); $title.find("li").click(function () { if ($(this).hasClass('no')) { return }; var index = $(this).index(); $title.find("li").removeClass("current"); $content.hide(); $(this).addClass("current").siblings().removeClass("current"); $content.eq(index).show(); return false; }) }) // $('body').rollbar({ zIndex: 100 }); var $solutions_box = $(".solutions_box"); $solutions_box.each(function () { $.easing.def = "easeOutCirc"; var $_this = $(this); var $solutions_content = $_this.find(".solutions_content"); var $solutions_list = $solutions_content.find(".solutions_list"); var $box = $solutions_list.find(".box"); var $len = $box.length; var $width = $box.width(); var direction = "-"; var index4 = 0; $solutions_list.width($len * $box.width()); $solutions_content.on("solutionsEvent", function () { $solutions_list.animate({ 'left': direction + '=' + $width }, 800, function () { $_this.trigger('BtnEvent'); }); }) $_this.on('click', ".left_btn", function () { if (index4 < 1) { return false; } else { index4--; } direction = "+"; $solutions_content.trigger("solutionsEvent"); }) $_this.on('click', ".right_btn", function () { if (index4 < $len - 1) { index4++; } else { return false; } direction = "-"; $solutions_content.trigger("solutionsEvent"); }) $_this.on("BtnEvent", function () { if (index4 == 0) { $(this).find(".left_btn").removeClass("disabled"); } else { $(this).find(".left_btn").addClass("disabled"); } if (index4 == ($len - 1)) { $(this).find(".right_btn").removeClass("disabled"); } else { $(this).find(".right_btn").addClass("disabled"); } }) }) var aboutHistory = $('#aboutHistory'); if (aboutHistory.length) { aboutHistory.PicRoall() }; var dataShow = $('[data-show]'); if (dataShow.length) { dataShow.on('click', function() { var show = $(this).data('show'); $(show).removeClass('hide').on('click', 'button', function() { $(show).addClass('hide'); }); }); }; var selectBox = $('.select-box'); selectBox.on('change', 'select', function() { var _this = $(this), i = _this.get(0).selectedIndex, val = _this.find('option').eq(i).text(); _this.siblings('p').text(val); }).find('select').trigger('change'); var Map = $('#Map'), MapList = $('#MapList'), Win = $(window); if (Map.length) { Map.on('mousemove', 'area', function(e) { var _this = $(this), index = _this.index(), x = e.pageX, y = e.pageY, left = Win.width()/2 < x ? x -515-5 : x-5, top = y+5; MapList.find('li').eq(index).removeClass('hide').css({ top: top + 'px', left: left + 'px' }); }).on('mouseout', 'area', function() { var _this = $(this), index = _this.index(); MapList.find('li').eq(index).addClass('hide'); }); }; $('.download').on('click',function(){ $('.pop-box').addClass('hide'); }) }); var server_box7 = { init: function () { var $Pop_upBox_bg = $(".Pop_upBox_bg"); var $server_box7 = $(".server_box7"); var $city = $server_box7.find(".city"); $city.each(function () { var _this = $(this); var $city_box = _this.find(".city_box"); var $city_h1 = _this.find("h1"); var $city_title = _this.find(".city_title"); var $city_list = _this.find(".list"); var $city_li = $city_box.find("li"); var $length = $city_li.length; var _width = $city_li.outerWidth(true); var _text = _this.find(".p_text").text(); $city_box.find("ul").width(_width * $length); //$city_list.css("left", -_width); $city_h1.text(_text); $city_title.html(_text); _this.mouseover(function () { $Pop_upBox_bg.removeClass("hide") $city_box.hide() _this.find(".city_box").show(); _this.css("z-index", "100").siblings().css("z-index", "0"); }) _this.mouseout(function () { $city.find(".city_box").hide(); $Pop_upBox_bg.addClass("hide") _this.css("z-index", "100").siblings().css("z-index", "100"); }) //$Pop_upBox_bg.on("click", function () { // $city_box.hide(); // $Pop_upBox_bg.addClass("hide") //}) }) } } $(function () { var movetime = 500; var maxw = 252; var $solutions_box = $("#solutions_box"); var _width = $solutions_box.width(); var _len = $solutions_box.find("li").length - 1; var avgw = parseInt((_width - maxw) / _len); $solutions_box.find("li").width(avgw) var index; var t = false; //延时执行 var _this; function cur(ele) { ele = $(ele) ? $(ele) : ele; ele.addClass("cur").siblings().removeClass("cur"); }; $("#solutions_box li:eq(0)").addClass("cur").animate({ "width": maxw + "px" }); $("#solutions_box").find("li").mouseover(function () { _this = $(this); index = $("#solutions_box li").index($(this)[0]); var act = function () { _this.siblings("li").removeClass("cur"); _this.animate({ "width": maxw + "px" }, { duration: movetime, easing: "easeOutQuart", complete: function () { cur(_this) } }).siblings("li").animate({ "width": avgw + "px" }, { duration: movetime }) } t = setTimeout(act, 200); return false; }).mouseout(function () { if (t) { clearTimeout(t); } }); var $server_btn = $(".server_btn"); if($server_btn.length) { var $server_li = $server_btn.find("li"); $server_li.each(function () { $(this).find("em").on("click", function () { $("#product_message").removeClass("hide") }) }) } })