Ticket #371 (reopened defect)
Fx.Scroll. max scroll impossible if there is border or scrollLine.
| Reported by: | magmoro@… | Owned by: | |
|---|---|---|---|
| Type: | defect | Priority: | minor |
| Milestone: | Mootools version 1.3 | Component: | Plugins |
| Keywords: | Fx.Scroll | Cc: |
Description
It's imposible full scroll with Fx.Scroll . Here example (strict mode):
http://theocp.info/studio/moro/Fx.Scroll/scroll.html
If u even set x or y very big u get not full scroll.
It because u use offsetWidth and offsetHeight (el.size[z]) when calculate max:
var el = this.element.getSize();
var values = {'x': x, 'y': y};
for (var z in el.size){
var max = el.scrollSize[z] - el.size[z];
...
U shoud use clienWidth and clientHeight.
Fix:
var el = this.element.getSize();
el.size={
x : this.element.clientWidth,
y : this.element.clientHeight
}
var values = {'x': x, 'y': y};
for (var z in el.size){
var max = el.scrollSize[z] - el.size[z];
Here fixed example:
http://theocp.info/studio/moro/Fx.Scroll/scrollFix.html
Tested in FF2 IE6 Opera 9.
Note: still there is some issue in Opera if padding!=0.