mswMove("xqtu", "xqbtn01", "xqbtn02", "", false, "left", true, 313, 1000, 3000, 1);
$('.tabbox li').each(function(index, element){
var _index = index;
$(this).click(function(){
$('.tabbox li').removeClass('cur');
$(this).addClass('cur');
$('.infobox').hide();
$('.infobox').eq(_index).show();
});
});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鐨刲eft鍊�*/
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鐨剅ight鍊�*/
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鐨刲eft鍊�*/
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鐨剅ight鍊�*/
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) {
/*鍒ゆ柇鏄惁闇€瑕佽疆鎾紝婊氬姩鎬绘暟灏忎綑鎴栬€呯瓑浜庣獥鍙f樉绀烘暟鐩�*/
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 });
});
$(".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)
});