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 showbg(e) { var t = $("#flashs .btn span").index($("#flashs .btn span.cur")); t < 0 && (t = 0), $("#flashs .btn span.cur").css("opacity", .7).removeClass("cur"), $("#flashbg" + t).css({ opacity: 0, "z-index": 1 } ), $("#flashbg" + showIndex).css({ "z-index": 2 } ), $("#flashbg" + showIndex).animate({ opacity: 1 } , 500), $("#flashs .btn span").eq(showIndex).css("opacity", 1).addClass("cur") } var showIndex = 1, h = $("#flashs div.bgitem").css("opacity", 0).length, btn = "
"; for (var i = 0; i < h; i++) btn += "" + (i + 1) + ""; btn += "
", $("#flashs").append(btn); $('#flashs .btn').css({'margin-left':(-1*$('#flashs .btn').innerWidth())/2 + 'px'}); $("#flashs .btn span").css("opacity", .7).mouseenter(function () { showIndex = $("#flashs .btn span").index(this), showbg(showIndex) } ).eq(0).trigger("mouseenter"), $("#flashs").hover(function () { clearInterval(picTimer) } , function () { picTimer = setInterval(function () { showIndex++, showIndex == h && (showIndex = 0), showbg(showIndex) } , 6000) } ).eq(0).trigger("mouseleave"); $( 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(); }); function Marquee() { this.ID = document.getElementById(arguments[0]); if(!this.ID) { alert("您要设置的\"" + arguments[0] + "\"初始化错误\r\n请检查标签ID设置是否正确!"); this.ID = -1; return; } this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0; this.Step = 1; this.Timer = 30; this.DirectionArray = { "top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3}; if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1]; if(typeof arguments[2] == "number")this.Step = arguments[2]; if(typeof arguments[3] == "number")this.Width = arguments[3]; if(typeof arguments[4] == "number")this.Height = arguments[4]; if(typeof arguments[5] == "number")this.Timer = arguments[5]; if(typeof arguments[6] == "number")this.DelayTime = arguments[6]; if(typeof arguments[7] == "number")this.WaitTime = arguments[7]; if(typeof arguments[8] == "number")this.ScrollStep = arguments[8]; this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden"; this.ID.noWrap = true; this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1); if(arguments.length >= 7)this.Start(); } Marquee.prototype.Start = function() { if(this.ID == -1)return; if(this.WaitTime < 800)this.WaitTime = 800; if(this.Timer < 20)this.Timer = 20; if(this.Width == 0)this.Width = parseInt(this.ID.style.width); if(this.Height == 0)this.Height = parseInt(this.ID.style.height); if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()]; this.HalfWidth = Math.round(this.Width / 2); this.HalfHeight = Math.round(this.Height / 2); this.BakStep = this.Step; this.ID.style.width = this.Width + "px"; this.ID.style.height = this.Height + "px"; if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height; var templateLeft = "
MSCLASS_TEMP_HTMLMSCLASS_TEMP_HTML
"; var templateTop = "
MSCLASS_TEMP_HTML
MSCLASS_TEMP_HTML
"; var msobj = this; msobj.tempHTML = msobj.ID.innerHTML; if(msobj.Direction <= 1) { msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML); } else { if(msobj.ScrollStep == 0 && msobj.DelayTime == 0) { msobj.ID.innerHTML += msobj.ID.innerHTML; } else { msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML); } } var timer = this.Timer; var delaytime = this.DelayTime; var waittime = this.WaitTime; msobj.StartID = function(){ msobj.Scroll()} msobj.Continue = function() { if(msobj.MouseOver == 1) { setTimeout(msobj.Continue,delaytime); } else { clearInterval(msobj.TimerID); msobj.CTL = msobj.Stop = 0; msobj.TimerID = setInterval(msobj.StartID,timer); } } msobj.Pause = function() { msobj.Stop = 1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,delaytime); } msobj.Begin = function() { msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth / 2 : msobj.ID.scrollHeight / 2; if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step)) { msobj.ID.innerHTML = msobj.tempHTML; delete(msobj.tempHTML); return; } delete(msobj.tempHTML); msobj.TimerID = setInterval(msobj.StartID,timer); if(msobj.ScrollStep < 0)return; msobj.ID.onmousemove = function(event) { if(msobj.ScrollStep == 0 && msobj.Direction > 1) { var event = event || window.event; if(window.event) { if(msobj.IsNotOpera) { msobj.EventLeft = event.srcElement.id == msobj.ID.id ? event.offsetX - msobj.ID.scrollLeft : event.srcElement.offsetLeft - msobj.ID.scrollLeft + event.offsetX; } else { msobj.ScrollStep = null; return; } } else { msobj.EventLeft = event.layerX - msobj.ID.scrollLeft; } msobj.Direction = msobj.EventLeft > msobj.HalfWidth ? 3 : 2; msobj.AbsCenter = Math.abs(msobj.HalfWidth - msobj.EventLeft); msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfWidth); } } msobj.ID.onmouseover = function() { if(msobj.ScrollStep == 0)return; msobj.MouseOver = 1; clearInterval(msobj.TimerID); } msobj.ID.onmouseout = function() { if(msobj.ScrollStep == 0) { if(msobj.Step == 0)msobj.Step = 1; return; } msobj.MouseOver = 0; if(msobj.Stop == 0) { clearInterval(msobj.TimerID); msobj.TimerID = setInterval(msobj.StartID,timer); } } } setTimeout(msobj.Begin,waittime); } Marquee.prototype.Scroll = function() { switch(this.Direction) { case 0: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollTop >= this.ClientScroll) { this.ID.scrollTop -= this.ClientScroll; } this.ID.scrollTop += this.Step; } break; case 1: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollTop <= 0) { this.ID.scrollTop += this.ClientScroll; } this.ID.scrollTop -= this.Step; } break; case 2: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollLeft >= this.ClientScroll) { this.ID.scrollLeft -= this.ClientScroll; } this.ID.scrollLeft += this.Step; } break; case 3: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollLeft <= 0) { this.ID.scrollLeft += this.ClientScroll; } this.ID.scrollLeft -= this.Step; } break; } } new Marquee("wenda", 0, 1, 365, 380, 40, 0, 1000, 22); $(".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) });