animate left/right textlist scrolling

This commit is contained in:
rolux 2011-05-24 22:22:18 +02:00
parent 6cd64efeb2
commit 2d98dfe754

View file

@ -61,12 +61,14 @@ Ox.TextList = function(options, self) {
.addClass('OxTextList')
.bindEvent({
key_left: function() {
var $element = that.$body.$element;
$element[0].scrollLeft = $element[0].scrollLeft - $element.width();
var $element = that.$body.$element,
scrollLeft = $element[0].scrollLeft - $element.width();
$element.animate({scrollLeft: scrollLeft}, 250);
},
key_right: function() {
var $element = that.$body.$element;
$element[0].scrollLeft = $element[0].scrollLeft + $element.width();
var $element = that.$body.$element,
scrollLeft = $element[0].scrollLeft + $element.width();
$element.animate({scrollLeft: scrollLeft}, 250);
},
keys: find
});