jacombs
21 Apr 2009, 8:50 AM
It appears that the rewrite for the Element.scroll method was not finished in 3.0rc1. As you can see below, it only includes code for scrolling to the left:
scroll : function(direction, distance, animate){
if(this.isScrollable()){
var el = this.dom,
l = el.scrollLeft, t = el.scrollTop,
w = el.scrollWidth, h = el.scrollHeight,
cw = el.clientWidth, ch = el.clientHeight,
scrolled = false,
l = Math.min(l + distance, w-cw),
r = Math.max(l - distance, 0),
t = Math.max(t - distance, 0),
b = Math.min(t + distance, h-ch),
hash = {
l : l,
left : l,
r : r,
right : r,
t : t,
top : t,
up : t,
b : b,
bottom : b,
down : b
};
direction = direction.toLowerCase();
if (v = hash[direction]) {
this.scrollTo("left", v, this.preanim(arguments, 2));
scrolled = true;
}
return scrolled;
}
scroll : function(direction, distance, animate){
if(this.isScrollable()){
var el = this.dom,
l = el.scrollLeft, t = el.scrollTop,
w = el.scrollWidth, h = el.scrollHeight,
cw = el.clientWidth, ch = el.clientHeight,
scrolled = false,
l = Math.min(l + distance, w-cw),
r = Math.max(l - distance, 0),
t = Math.max(t - distance, 0),
b = Math.min(t + distance, h-ch),
hash = {
l : l,
left : l,
r : r,
right : r,
t : t,
top : t,
up : t,
b : b,
bottom : b,
down : b
};
direction = direction.toLowerCase();
if (v = hash[direction]) {
this.scrollTo("left", v, this.preanim(arguments, 2));
scrolled = true;
}
return scrolled;
}