// JavaScript Document //首页新闻中心选项卡切换 $(document).ready(function(e) { var ind = 0; $(".newssel_nei_op").eq(ind).addClass("on"); $(".newsxxk").hide(); $(".newsxxk").eq(ind).show(); $(".newssel_nei_op").click(function() { ind = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); $(".newsxxk").hide(); $(".newsxxk").eq(ind).show(); }); }); // 首页产品中心选项卡切换 $(document).ready( function(e) { var ind = 0; $(".prosel_nei div").eq(ind).addClass("on"); $(".proxxk_xun").eq(ind).show(); var ml = $(".prosel_nei div.on").offset().left; var w = $(".prosel_nei div.on").width(); $(".prosel_xian div").css({ "margin-left" : ml, "width" : w }); $(".prosel_nei div").hover(function() { ml = $(this).offset().left; w = $(this).width(); $(".prosel_xian div").css({ "margin-left" : ml, "width" : w }); }, function() { ml = $(".prosel_nei div.on").offset().left; w = $(".prosel_nei div.on").width(); $(".prosel_xian div").css({ "margin-left" : ml, "width" : w }); }); $(".prosel_nei div").click(function() { ind = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); ml = $(".prosel_nei div.on").offset().left; w = $(".prosel_nei div.on").width(); $(".prosel_xian div").css({ "margin-left" : ml, "width" : w }); $(".proxxk_xun").hide(); $(".proxxk_xun").eq(ind).show(); }); var boxlen = $(".proxxk_xun").length; var neilen, maxw, xunml, boxw; for (var i = 0; i < boxlen; i++) { neilen = $(".proxxk_xun").eq(i).find("a").length; maxw = neilen * 283; $(".proxxk_xun").eq(i).attr({ "lenght" : neilen, "maxwidth" : maxw }); $(".proxxk_xun").eq(i).find(".pxb_xun").css({ "width" : maxw }); } $(".proxxk_xun_right") .click( function() { boxw = parseInt($(this).parents(".proxxk_xun") .width()) + 32; maxw = parseInt($(this).parents(".proxxk_xun") .attr("maxwidth")); xunml = parseInt($(this).parents(".proxxk_xun") .find(".pxb_xun").css("margin-left")); xunml = xunml - 283; if ($(this).parents(".proxxk_xun").find( ".pxb_xun").width() < boxw) { return; } if (xunml < (boxw - maxw)) { xunml = (boxw - maxw); } $(this).parents(".proxxk_xun").find(".pxb_xun") .animate({ "margin-left" : xunml }); }); $(".proxxk_xun_left").click( function() { xunml = parseInt($(this).parents(".proxxk_xun").find( ".pxb_xun").css("margin-left")); xunml = xunml + 283; if (xunml >= 0) { xunml = 0; } $(this).parents(".proxxk_xun").find(".pxb_xun") .animate({ "margin-left" : xunml }); }); }); // JavaScript Document