This project is archived and is in readonly mode.

#1073 ✓wontfix
Olivier Laviale

getSize() and getScroll() are broken when used in an IFRAME

Reported by Olivier Laviale | November 7th, 2010 @ 10:48 AM | in 1.4.0 (closed)

Hello,

The getSize() and getScroll() methods are broken when they are used on an element inside an IFRAME. This is because the ownerDocument object of the HTML element in the IFRAME element has no window property.

Here is a fix :

  getSize: function(){
        if (isBody(this)) {
            var window = this.getWindow();
            if (window) return window.getSize();
        }
        return {x: this.offsetWidth, y: this.offsetHeight};
    },

    getScroll: function(){
        if (isBody(this)) {
            var window = this.getWindow();
            if (window) return window.getScroll();
        }
        return {x: this.scrollLeft, y: this.scrollTop};
    },

You might want to fix the getScrollSize() method too.

Best regards,

Olivier Laviale

Comments and changes to this ticket

  • Christoph Pojer

    Christoph Pojer November 9th, 2010 @ 05:40 PM

    • State changed from “new” to “open”
    • Milestone set to 1.3.1
    • Assigned user set to “Fábio M. Costa”
    • Milestone order changed from “821” to “0”

    Fabio, what do you say?

  • Fábio M. Costa

    Fábio M. Costa February 23rd, 2011 @ 03:39 AM

    • Milestone changed from 1.3.1 to 1.4.0
    • Assigned user changed from “Fábio M. Costa” to “Arian”
    • Milestone order changed from “6” to “0”
  • Christoph Pojer

    Christoph Pojer August 13th, 2011 @ 12:51 AM

    • State changed from “open” to “wontfix”

    We won't support these kinda features in the future. Please load MooTools inside of the iframe and use these methods inside of the iframe.

Create your profile

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

Shared Ticket Bins

Pages