jQuery工具 - 垂直可滚动

时间:2011-04-29 00:23:38

标签: jquery jquery-tools scrollable

我有这段代码:

<script type="text/javascript" src="../JavaScripts/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="../JavaScripts/jquery.tools.min.js"></script>

<script type="text/javascript">
$(function() {

    // initialize scrollable
    $(".articles").scrollable({ vertical: true });

});



</script>

我在Firebug中收到此错误

function (a) {a.tools = a.tools || {version: "@VERSION"}, a.tools.tabs = {conf: {tabs: "a", current: "current", onBeforeClick: null, onClick: null, effect: "default", initialIndex: 0, event: "click", rotate: !1, history: !1}, addEffect: function (a, c) {b[a] = c;}};var b = {default: function (a, b) {this.getPanes().hide().eq(a).show(), b.call();}, fade: function (a, b) {var c = this.getConf(), d = c.fadeOutSpeed, e = this.getPanes();d ? e.fadeOut(d) : e.hide(), e.eq(a).fadeIn(c.fadeInSpeed, b);}, slide: function (a, b) {this.getPanes().slideUp(200), this.getPanes().eq(a).slideDown(400, b);}, ajax: function (a, b) {this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"), b);}}, c;a.tools.tabs.addEffect("horizontal", function (b, d) {c || (c = this.getPanes().eq(0).width()), this.getCurrentPane().animate({width: 0}, function () {a(this).hide();}), this.getPanes().eq(b).animate({width: c}, function () {a(this).show(), d.call();});}); function d(c, d, e) {var f = this, g = c.add(this), h = c.find(e.tabs), i = d.jquery ? d : c.children(d), j;h.length || (h = c.children()), i.length || (i = c.parent().find(d)), i.length || (i = a(d)), a.extend(this, {click: function (c, d) {var i = h.eq(c);typeof c == "string" && c.replace("#", "") && (i = h.filter("[href*=" + c.replace("#", "") + "]"), c = Math.max(h.index(i), 0));if (e.rotate) {var k = h.length - 1;if (c < 0) {return f.click(k, d);}if (c > k) {return f.click(0, d);}}if (!i.length) {if (j >= 0) {return f;}c = e.initialIndex, i = h.eq(c);}if (c === j) {return f;}d = d || a.Event(), d.type = "onBeforeClick", g.trigger(d, [c]);if (!d.isDefaultPrevented()) {b[e.effect].call(f, c, function () {d.type = "onClick", g.trigger(d, [c]);}), j = c, h.removeClass(e.current), i.addClass(e.current);return f;}}, getConf: function () {return e;}, getTabs: function () {return h;}, getPanes: function () {return i;}, getCurrentPane: function () {return i.eq(j);}, getCurrentTab: function () {return h.eq(j);}, getIndex: function () {return j;}, next: function () {return f.click(j + 1);}, prev: function () {return f.click(j - 1);}, destroy: function () {h.unbind(e.event).removeClass(e.current), i.find("a[href^=#]").unbind("click.T");return f;}}), a.each("onBeforeClick,onClick".split(","), function (b, c) {a.isFunction(e[c]) && a(f).bind(c, e[c]), f[c] = function (b) {b && a(f).bind(c, b);return f;};}), e.history && a.fn.history && (a.tools.history.init(h), e.event = "history"), h.each(function (b) {a(this).bind(e.event, function (a) {f.click(b, a);return a.preventDefault();});}), i.find("a[href^=#]").bind("click.T", function (b) {f.click(a(this).attr("href"), b);}), location.hash && e.tabs == "a" && c.find("[href=" + location.hash + "]").length ? f.click(location.hash) : (e.initialIndex === 0 || e.initialIndex > 0) && f.click(e.initialIndex);} a.fn.tabs = function (b, c) {var e = this.data("tabs");e && (e.destroy(), this.removeData("tabs")), a.isFunction(c) && (c = {onBeforeClick: c}), c = a.extend({}, a.tools.tabs.conf, c), this.each(function () {e = new d(a(this), b, c), a(this).data("tabs", e);});return c.api ? e : this;};}(jQuery) is not a function
[Break On This Error] (function(a){a.tools=a.tools||{version...handle.call(this,b,b.delta)}})(jQuery)
jquery....min.js (line 29)

但是当我从他们的网站上加入它时,每件事情都运转正常

为什么我收到此错误?

1 个答案:

答案 0 :(得分:0)

如果用

替换JS src会发生什么

http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js

或者将jQuery更改为:

$(function() {

    // initialize scrollable
    $(".articles").scrollable({ vertical: true, mousewheel: true });

});