function mswMove(boxID, btn_left, btn_right, btnBox, Car, direction, way, moveLengh, speed, Interval, number) { var _ID = $("#" + boxID + ""); var _btn_left = $("#" + btn_left + ""); var _btn_right = $("#" + btn_right + ""); var _btnBox = $("#" + btnBox + ""); var jsq = 0/*底部按钮切换计数器*/ var timer; /*轮播时间设置*/ var cj; /*底部按钮数值差值*/ var no_way = 0; var no_wayGet = 0; var ID_liLen, ID_liheight, cbtmBtn; ID_liLen = _ID.find("li").length; ID_liheight = _ID.find("li").innerHeight(); /*判断滚动方向:上下左右*/ if (direction == "left" || direction == "right") { _ID.find("ul").width(ID_liLen * moveLengh); } else if (direction == "top" || direction == "bottom") { _ID.find("ul").height(ID_liLen * moveLengh); _btnBox.hide() } _btnBox.empty(); for (i = 0; i < ID_liLen; i++) { _btnBox.append(""); }; _btnBox.find("span").eq(0).addClass("cur"); if (way == false) { _btn_left.hide(); _btn_right.hide(); _btnBox.hide(); } /*自动轮播*/ function Carousel() { if (way == false) { /*非间断式滚动*/ no_way++; if (direction == "left") { _ID.find("ul").css({ "left": -no_way } ); no_wayGet = parseInt(_ID.find("ul").css("left")); /*获取ul的left值*/ if (no_wayGet == -moveLengh) { no_way = 0 _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({ "left": 0 } ); } } /*向左滚动*/ if (direction == "right") { no_wayGet = parseInt(_ID.find("ul").css("left")); /*获取ul的right值*/ if (no_wayGet == 0) { no_way = -moveLengh _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({ "left": 0 } ); } _ID.find("ul").css({ "left": no_way } ); } /*向右滚动*/ if (direction == "top") { _ID.find("ul").css({ "top": -no_way } ); no_wayGet = parseInt(_ID.find("ul").css("top")); /*获取ul的left值*/ if (no_wayGet == -moveLengh) { no_way = 0 _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({ "top": 0 } ); } } /*向上滚动*/ if (direction == "bottom") { no_wayGet = parseInt(_ID.find("ul").css("top")); /*获取ul的right值*/ if (no_wayGet == 0) { no_way = -moveLengh _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({ "top": 0 } ); } _ID.find("ul").css({ "top": no_way } ); } /*向下滚动*/ } else if (way == true) { /*间断式滚动*/ if (direction == "left") { _ID.find("ul").animate({ left: -moveLengh } , speed, function () { _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({ "left": 0 } ); } ); if (jsq < ID_liLen - 1) { jsq++; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); } else { jsq = 0; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); } } /*向左滚动*/ if (direction == "right") { _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({ "left": -moveLengh } ); _ID.find("ul").stop().animate({ left: 0 } , speed); if (jsq > 0) { jsq--; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); } else { jsq = ID_liLen - 1; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); } } /*向右滚动*/ if (direction == "top") { _ID.find("ul").animate({ top: -moveLengh } , speed, function () { _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({ "top": 0 } ); } ); } /*向上滚动*/ if (direction == "bottom") { _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({ "top": -moveLengh } ); _ID.find("ul").stop().animate({ top: 0 } , speed); } /*向下滚动*/ } /*判断滚动方式*/ } /*end Carousel*/ /*是否需要自动轮播*/ if (Car == true) { /*判断是否需要轮播,滚动总数小余或者等于窗口显示数目*/ if (ID_liLen > number) { timer = setInterval(Carousel, Interval); } else { clearInterval(timer); _btn_left.hide(); _btn_right.hide(); _btnBox.hide(); } } else { clearInterval(timer); } _ID.find("li").hover(function () { clearInterval(timer); } , function () { if (Car == true) { if (ID_liLen > number) { timer = setInterval(Carousel, Interval); } else { clearInterval(timer); _btn_left.hide(); _btn_right.hide(); _btnBox.hide(); } } else { clearInterval(timer); } } ); /*click右边按钮*/ _btn_right.hover(function () { clearInterval(timer); } , function () { if (Car == true) { if (ID_liLen > number) { timer = setInterval(Carousel, Interval); } else { clearInterval(timer); _btn_left.hide(); _btn_right.hide(); _btnBox.hide(); } } else { clearInterval(timer); } } ).click(function () { if (direction == "left" || direction == "right") { _ID.find("ul").animate({ left: -moveLengh } , speed, function () { _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({ "left": 0 } ); } ); } if (direction == "top" || direction == "bottom") { _ID.find("ul").animate({ top: -moveLengh } , speed, function () { _ID.find("li:first").insertAfter(_ID.find("li:last")); _ID.find("ul").css({ "top": 0 } ); } ); } if (jsq < ID_liLen - 1) { jsq++; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); } else { jsq = 0; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); }; } ); /*click左边按钮*/ _btn_left.hover(function () { clearInterval(timer); } , function () { if (Car == true) { if (ID_liLen > number) { timer = setInterval(Carousel, Interval); } else { clearInterval(timer); _btn_left.hide(); _btn_right.hide(); _btnBox.hide(); } } else { clearInterval(timer); } } ).click(function () { if (direction == "left" || direction == "right") { _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({ "left": -moveLengh } ); _ID.find("ul").stop().animate({ left: 0 } , speed); } if (direction == "top" || direction == "bottom") { _ID.find("li:last").insertBefore(_ID.find("li:first")); _ID.find("ul").css({ "top": -moveLengh } ); _ID.find("ul").stop().animate({ top: 0 } , speed); } if (jsq > 0) { jsq--; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); } else { jsq = ID_liLen - 1; _btnBox.find("span").eq(jsq).addClass("cur").siblings().removeClass("cur"); }; } ); /*底部按钮*/ _btnBox.find("span").hover(function () { clearInterval(timer); } , function () { if (Car == true) { if (ID_liLen > number) { timer = setInterval(Carousel, Interval); } else { clearInterval(timer); _btn_left.hide(); _btn_right.hide(); _btnBox.hide(); } } else { clearInterval(timer); } } ).click(function () { cbtmBtn = $(this).index(); $(this).addClass("cur").siblings().removeClass("cur"); if (cbtmBtn > jsq) { cj = cbtmBtn - jsq; jsq = cbtmBtn; _ID.find("ul").stop().animate({ left: -moveLengh * cj } , speed, function () { for (i = 0; i < cj; i++) { _ID.find("ul").css({ "left": 0 } ) _ID.find("li:first").insertAfter(_ID.find("li:last")); }; } ); } else { cj = jsq - cbtmBtn; jsq = cbtmBtn; _ID.find("ul").css({ "left": -moveLengh * cj } ); for (i = 0; i < cj; i++) { _ID.find("ul").stop().animate({ left: 0 } , speed); _ID.find("li:last").insertBefore(_ID.find("li:first")); }; }; } ); } function _addFavorite() { var url = window.location; var title = document.title; var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("360se") > -1) { alert("由于360浏览器功能限制,请按 Ctrl+D 手动收藏!"); } else if (ua.indexOf("msie 8") > -1) { window.external.AddToFavoritesBar(url, title); //IE8 } else if (document.all) {//IE类浏览器 try{ window.external.addFavorite(url, title); }catch(e){ alert('您的浏览器不支持,请按 Ctrl+D 手动收藏!'); } } else if (window.sidebar) {//firfox等浏览器; window.sidebar.addPanel(title, url, ""); } else { alert('您的浏览器不支持,请按 Ctrl+D 手动收藏!'); } } $('.j_sekeyword').attr('placeholder', '请输入关键词搜索'); $('.j_sekeyword').attr('name', 'keywords'); $('.j_sekeyword').val(''); $.getScript('/assets/addons/blog/common/PCchajian/jquery.SuperSlide.2.1.1.js',function(){ jQuery("#nav").slide({ type: "menu", titCell: ".nLi", targetCell: ".sub", effect: "slideDown", delayTime: 300, triggerTime: 0, returnDefault: true }); });$( function () { $(".pro .leftpro .menu li").eq(0).find(".nmenu").show(); $(".pro .leftpro .menu li").eq(1).find(".nmenu").show(); $(".pro .leftpro .menu li").click( function () { $(this).find(".nmenu").slideDown() $(this).siblings().find(".nmenu").slideUp() $(this).addClass("cur") $(this).siblings().removeClass("cur"); } ) } ); $('.pro .leftpro .menu li .nmenu > div').mouseenter(function(){ $(this).children('.submenu').show(); }); $('.pro .leftpro .menu li .nmenu > div').mouseleave(function(){ $(this).children('.submenu').hide(); }); $(".yb_conct").hover(function() { $(".yb_conct").css("right", "5px"); $(".yb_bar .yb_ercode").css('height', '200px'); }, function() { $(".yb_conct").css("right", "-127px"); $(".yb_bar .yb_ercode").css('height', '53px'); }); // 返回顶部 $(".yb_top").click(function() { $("html,body").animate({ 'scrollTop': '0px' }, 300) });