$(function() { banner(); showimg(); /*经典竞博体育官方版下载*/ $("#icase").slide({ titCell: '.hd ul', mainCell: '.bd ul', autoPlay: true, effect: "leftLoop", autoPage: true, delayTime: 500, interTime: 5000, trigger: "click", vis: 4 }); /*产品中心-推荐*/ $("#product").slide({ titCell: '.hd ul', mainCell: '.bd ul', autoPlay: true, effect: "leftLoop", autoPage: true, delayTime: 500, interTime: 5000, trigger: "click", vis: 1 }); /*新闻资讯*/ $("#newsBox").slide({ titCell: '.hd ul', mainCell: '.bd ul', autoPlay: true, effect: "leftLoop", autoPage: true, delayTime: 500, interTime: 5000, trigger: "click", vis: 1 }); $(".ewmbtn").click(function() { $("body .ewmbox").show(); layout(1); }); $(".ewmbox .close").click(function() { $(".ewmbox").hide(); layout(0); }); $("#xcxbtn").click(function() { $("body .ewmbox").show(); layout(1); }); $("#xcxbtn1").click(function() { $("body .ewmbox").show(); layout(1); }); $(".ewmbox .close").click(function() { $(".ewmbox").hide(); layout(0); }); $("#top").click(function() { $("body, html").stop().animate({ "scrollTop": 0 }); }); }); function showimg() { if ($("#showimg").length > 0) { $('#showimg').banqh({ box: "#showimg", //总框架 pic: "#bigimg", //大图框架 pnum: "#smallimg", //小图框架 prev_btn: ".prev", //小图左箭头 next_btn: ".next", //小图右箭头 autoplay: true, //是否自动播放 interTime: 5000, //图片自动切换间隔 delayTime: 400, //切换一张图片时间 order: 0, //当前显示的图片(从0开始) picdire: true, //大图滚动方向(true为水平方向滚动) mindire: true, //小图滚动方向(true为水平方向滚动) min_picnum: 5, //小图显示数量 pop_up: false //大图是否有弹出框 }); } } $('#toolbar dd').bind({ 'mouseenter': function() { if ($(this).children('.slide').length) { var _this = $(this).children('.slide'); _this.stop(true, true).animate({ 'width': 220 }, 200); } else if ($(this).children('.pop').length) { var _this = $(this).children('.pop'); _this.show().animate({ 'right': 65 }, 200); } }, 'mouseleave': function() { if ($(this).children('.slide').length) { var _this = $(this).children('.slide'); _this.stop(false, false).animate({ 'width': 0 }, 200); } else if ($(this).children('.pop').length) { var _this = $(this).children('.pop'); _this.hide().animate({ 'right': 90 }, 230); } } }); // banner function banner() { if (!$("#banner").length || $("#banner .list li").length <= 1) { return false; } var _this = $("#banner"), me = $("#banner .list"), tip = $("#banner .tip"), prev = _this.find("#btn_prev"), next = _this.find("#btn_next"), t, interval = 5000, speed = 1000, speed2 = 700, n = 0, N = me.children("li").length; me.find("li:gt(0)").hide(); if ($("#banner .tip").length) { var htmlTip = ""; for (var i = 0; i < N; i++) { if (i == 0) { htmlTip += ""; } else { htmlTip += ""; } } tip.append(htmlTip); } var func = function() { if (n >= N - 1) { n = 0; } 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"); } } t = setInterval(func, interval); next.bind("click", function() { clearInterval(t); func(); }); prev.bind("click", function() { clearInterval(t); n -= 2; n < -1 ? n = N - 2 : n; func(); }); tip.children("span").mouseover(function() { clearInterval(t); n = $(this).index() - 1; func(); }); $("#banner").hover(function() { $("#btn_prev,#btn_next").fadeIn() }, function() { $("#btn_prev,#btn_next").fadeOut() }) $("#banner_main").hover(function() { console.log(1) clearInterval(t); }, function() { console.log(2) t = setInterval(func, interval); }); } //layout function layout(u) { var $obj = $('
'); if (u == 0) { $('.dialog-layout').remove(); } else { if (!$('.dialog-layout').length) { $obj.appendTo('body').show(); } } }