This project is archived and is in readonly mode.

#562 ✓resolved

Fx.Scroll.toElement Bug in IE7

Reported by WiseManSam | January 20th, 2009 @ 01:19 PM | in 1.3.0 rc2 (closed)

Creates a horizontal scroll based on FX.Scroll to scroll dynamic div's from a webservice (attached - does include some debug code). .toElement works in Firefox but not in IE7.0.5730.13. Fix is attached below.

start: function(x, y){ if (!this.check(arguments.callee, x, y)) return this; var offsetSize = this.element.getSize(), scrollSize = this.element.getScrollSize(); var scroll = this.element.getScroll(), values = { x: x, y: y }; for (var z in values) {

var max = scrollSize[z] - offsetSize[z];
// scrolling left had -ve value in values[x] - .limit set these to zero.
if ($chk(values[z])) values[z] = ($type(values[z]) == 'number') ? values[z] : max;
else values[z] = scroll[z];
if (Browser.Engine.trident){
  // add to scroll[z] as this is a scroll relative to this.element
  values[z] = (values[z] + this.options.offset[z] + scroll[z]).limit(0, max)
  values[z] = (values[z] + this.options.offset[z]).limit(0, max)

} return this.parent([scroll.x, scroll.y], [values.x, values.y]); },

In addition Elements.getScrollSize may cause problems - this fix may cause more!

getScrollSize: function(){ if (isBody(this)) return this.getWindow().getScrollSize();

//if there are no scrollbars, IE gives the actual height of the content instead of the height of the element return { x: this.scrollWidth, y: this.scrollHeight < this.clientHeight ? this.clientHeight : this.scrollHeight };

Tested in IE7 and FireFox 3.03.

Comments and changes to this ticket

  • Aaron Newton

    Aaron Newton February 18th, 2009 @ 11:32 PM

    • Assigned user changed from “Valerio” to “Aaron Newton”
    • Milestone cleared.
  • Adam Florin

    Adam Florin May 27th, 2009 @ 03:24 PM


    Confirmed that Fx.Scroll is hosed in IE7, exhibiting pathological behavior. You can call toElement() repeatedly, passing in the same element id, and it will scroll to a new pseudo-random place each time.

    Pasting in WiseManSam's patch of the 'start' method fixed the issue. Also tested in FF2Win, FF3Mac, Saf3Mac, still copacetic.

    I'm using MooTools More (?!)

  • fakedarren

    fakedarren February 8th, 2010 @ 07:14 PM

    • State changed from “new” to “hold”
    • Assigned user changed from “Aaron Newton” to “fakedarren”
    • Milestone set to 1.3.0 rc2

    I'm putting this on hold because there are a million other Scroll issues, I assume they've all been resolved as one, but will update issue accordingly.

  • fakedarren

    fakedarren February 14th, 2010 @ 01:26 PM

    • State changed from “hold” to “resolved”

    I have to mark this issue as resolved, we need a test case in a shell, and we've made numerous changes / improvements to the way we calculate dimensions since the ticket and last comment. So I have to assume it has been resolved and duplicated in other fixed tickets. Or it would have a different behaviour.

    If you can confirm this is still an issue, please comment to that effect and provide a shell showing the issue.

    Apologies for the delay in replying. We'll be more responsive in the future.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins