Permalink
Browse files

Merge pull request #1269 from SergioCrisostomo/scroller-fix

Scroller fix
  • Loading branch information...
arian committed Jun 23, 2014
2 parents 43a2d89 + aeecaa0 commit 5f82f73673d0d491741a5beca5585ebb5a7773a5
Showing with 20 additions and 10 deletions.
  1. +19 −9 Docs/Interface/Scroller.md
  2. +1 −1 Source/Interface/Scroller.js
View
@@ -23,7 +23,7 @@ Scroller Method: constructor
### Arguments
1. element - (*element*) The element to scroll.
1. element - (*mixed*) The element to scroll, or it's id.
2. options - (*object*, optional) An object for the Scroller instance's options.
#### Options :
@@ -47,15 +47,25 @@ Scroller Method: constructor
#### Examples
var myScroller = new Scroller(window, {
area: Math.round(window.getWidth() / 5)
new Element('div', {
styles: {
width: 600,
height: 400
}
}).inject(new Element('div', {
id: 'myScroll',
styles: {
width: 300,
height: 200,
overflow: 'scroll'
}
}).inject($(document.body)))
var myScroller = new Scroller('myScroll', {
area: Math.round(window.getWidth() / 10)
});
(function(){
this.stop();
this.start();
}).periodical(1000, myScroller);
myScroller.start();
Scroller Method: start {#Scroller:start}
@@ -85,7 +85,7 @@ var Scroller = new Class({
scroll: function(){
var size = this.element.getSize(),
scroll = this.element.getScroll(),
pos = this.element != this.docBody ? this.element.getOffsets() : {x: 0, y:0},
pos = ((this.element != this.docBody) && (this.element != window)) ? element.getOffsets() : {x: 0, y: 0},
scrollSize = this.element.getScrollSize(),
change = {x: 0, y: 0},
top = this.options.area.top || this.options.area,

0 comments on commit 5f82f73

Please sign in to comment.