好库网
(function (b) { var a = new Array(); b.fn.extend({ Scroll: function (j, n) { if (!j) { var j = {} } var d = this; var m; var l = this.eq(0).find("ul:first"); var c = j.height ? parseInt(j.height, 10) : 48, f = j.line ? parseInt(j.line, 10) : parseInt(this.height() / c, 10), g = j.speed ? parseInt(j.speed, 10) : 500, e = j.timer ? parseInt(j.timer, 10) : 3000; if (f == 0) { f = 1 } var h = 0 - f * c; k(); scrollUp = function (q, p, s) { var o = d; var r = b(q).eq(0).find("ul:first"); r.animate({ marginTop: p }, g, function () { for (i = 1; i <= s; i++) { r.find("li:first").appendTo(r) } r.css({ marginTop: 0 }) }) }; function k() { var o = false; for (i = 0; i < a.length; i++) { var p = a[i].split(";"); if (p[0] == d[0].id) { o = true } } } _scrollUp = function (q) { var p, r; for (i = 0; i < a.length; i++) { var o = a[i].split(";"); if (o[0] == q) { p = o[1]; r = o[2] } } scrollUp("#" + q, p, r) }; d.hover(function () { clearInterval(m) }, function () { m = setInterval("_scrollUp('" + d[0].id + "')", e) }).mouseout() } }) })(jQuery); $(document).ready(function () { $(".tabs-left div:even,.tabs-middle div:even,.tabs-right div:even").bind("mouseover", function () { var a = $(this); if (this.lang == "noshow") return; var b = a.parent(); b.find("div[class*='selected']").each(function () { var d = $(this).attr("class").split(" ")[1]; $(this).attr("class", "tabs-head " + d.replace(/-selected/, "")) }); b.find("div[class*='split']").each(function () { $(this).attr("class", "tabs-head split-middle") }); a.prev("div[class*='split']:first").attr("class", "tabs-head split-left"); a.attr("class", a.attr("class") + "-selected"); a.next("div[class*='split']:first").attr("class", "tabs-head split-right"); b.parent().find("div[flag^='tab-content']:visible").hide(); $("#" + a.attr("class").split(" ")[1].replace(/-selected/, "")).show() }); $("#lastestMessage").Scroll({ line: 2, speed: 1300, timer: 4000, height: 72 }) }); function subChar(c, a) { var d = 0, e = 0; for (d = 0; d < c.length; d++) { var b = c.charCodeAt(d); if (b >= 0 && b <= 255) { ++e } else { e += 2 } if (e > a) { break } } return c.substr(0, d) };