$(function () { banner(); share(); inews(); slidedown(); $("#product").slide({ titCell: '.hd ul', mainCell: ".bd .list", autoPage: true, effect: "left", autoPlay: true, delayTime: 500, interTime: 5000, trigger: "click", vis: 4 }); $("#inews").slide({ titCell: '.hd ul', mainCell: ".bd .list", autoPage: true, effect: "left", autoPlay: true, delayTime: 500, interTime: 5000, trigger: "click", vis: 1 }); $("#icase").slide({ titCell: '.hd ul', mainCell: ".bd .list", autoPage: true, effect: "left", autoPlay: true, delayTime: 500, interTime: 5000, trigger: "click", vis: 4 }); $(".returnTop2,.returnTop").click(function () { $("body, html").stop().animate({ "scrollTop": 0 }); }); if ($(".imglist").length) { $(".imglist").each(function () { var _this = $(this); imglist(_this); }); } $(".top_main .top_right .sou").hover(function(){ $(".search").stop().slideDown(); },function(){ $(".search").stop().slideUp(); }); $("#addFavo").click(function () { var fm = $("title").html(); AddFavorite(fm, location.href, ''); }); $("#setHome").click(function () { SetHome($('title').html(), location.href, ''); }); // map_ul $(".map_ul > li").each(function () { if (!$(this).find("li").length) { $(this).find("ul").remove(); } }); $(".rightFix .share").hover(function () { $(this).find(".box").stop(true, true).slideDown(); }, function () { $(this).find(".box").stop(true, true).slideUp(); }); $(".fix_top").click(function () { $("body, html").stop().animate({ "scrollTop": "0px" }); }) }); // 主导航 - 上拉 function slidedown() {} $(".toolbar_tab").hover(function () { $(this).find("em").stop().animate({ "left": "-130px" }, 300) }, function () { $(this).find("em").stop().animate({ "left": "80px" }, 300) }); $("#test").click(function () { $("body, html").stop().animate({ "scrollTop": 0 }); }); // banner焦点图 function banner() { if (!$("#banner").length || $("#banner li").length <= 1) { return false; } $("#banner ul li:gt(0)").css({ "display": "none" }); var b = $("#banner"), me = $("#banner ul"), tip = $("#banner .tip"), t, interval = 10000, speed = 1000, speed2 = 700, n = 0, N = me.children("li").length; wid = b.children("li").width(); step = 200, time = 4000; if ($("#banner .tip").length) { var htmlTip = ""; for (var i = 0; i < N; i++) { if (i == 0) { htmlTip += "" + (i + 1) + ""; } else { htmlTip += "" + (i + 1) + ""; } } tip.html(htmlTip); } var func = function () { if (n >= N - 1) { n = 0; } else if (n < -1) { n = N - 1; } else { n++; } me.children("li").eq(n).css({ "z-index": 2 }).stop().fadeIn(speed).siblings("li").css({ "z-index": 1 }).stop().fadeOut(speed2); if ($("#banner .tip").length) { tip.children("span").eq(n).addClass("cur").siblings("span").removeClass("cur"); $("#num").text(n + 1); } } $dragBln = false; $("#btn_prev").click(function () { clearInterval(t); n -= 2; func(); t = setInterval(func, time) }); $("#btn_next").click(function () { clearInterval(t); func(); t = setInterval(func, time) }); tip.children("span").click(function () { clearInterval(t); n = $(this).index() - 1; func(); t = setInterval(func, interval); }) $("#banner ul.list li").mouseenter(function () { clearInterval(t); }).mouseleave(function () { t = setInterval(func, time); }); t = setInterval(func, interval); } //inews function inews() { var $a = $("#inews").find(".tog").find("div"); var i = 2; var page = 1; var $v_show = $("#inews .inewsCon .list"); var $v_content = $("#inews .inewsCon"); var v_width = $v_content.width(); var len = $v_content.find(".item").length; var page_count = Math.ceil(len / i); $v_show.width(page_count * v_width); if (len < 3) { $a.hide(); } $a.click(function () { var $sty = $(this).attr("class"); if (!$v_show.is(":animated")) { if ($sty == "prev") { if (page == 1) { $v_show.animate({ left: -v_width * (page_count - 1) + "px" }, 500); page = page_count; } else { $v_show.animate({ left: "+=" + v_width + "px" }, 500); page--; } } if ($sty == "next") { if (page == page_count) { $v_show.animate({ left: 0 }, 500); page = 1; } else { $v_show.animate({ left: "-=" + v_width + "px" }, 500); page++; } } } }); } function imglist(_this) { // 新闻tab切换 $('#irepro .top h3').click(function () { var index = $(this).index(); $(this).addClass("hover").siblings().removeClass("hover"); $(this).parents("#irepro").find(".bottom .imglist").eq(index).show().siblings().hide(); }); } function layout(u) { var $obj = $('
'); if (u == 0) { $('.dialog-layout').remove(); } else { if (!$('.dialog-layout').length) { $obj.appendTo('body').show(); } } } function share() { window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {}, "slide": { // 跟图标式的代码相比,这里是添加了浮窗式 slide 属性配置 "type": "slide", "bdImg": "6", "bdPos": "left", "bdTop": "100" } }; window._bd_share_config = { share : [{ "bdSize" : 16 }], } with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)]; }