Skip to content

calculated scroll position is wrong #243

Closed
@thenewguy

Description

@thenewguy

I have encountered an issue where the host page is being scrolled to the wrong offset.

I've attempted to override scrollCallback like the following:

        iFrameResize({
            log: true,
            checkOrigin: false,
            heightCalculationMethod: 'taggedElement',
            autoResize: false,
            enablePublicMethods: true,
            scrollCallback: function (x, y) {
                console.log("[OVERRIDE] overrode scrollCallback");
                window.scrollTo(x, y-50);
                return false;
            }
        })

The issue is that any time the page is manually resized via the contentframe's parentIFrame.size function the scrollCallback override function is bypassed.

I am testing embedding the iframe into a boostrapped page. The problem is that the bootstrap header overlaps the iFrame when it is scrolled to. In this case the header is 50px. So when the host page scrolls to the iFrame it scrolls too far and the header covers some of the iframe.

Is there any way to adjust the coords for all scrolling instead of only scroll methods triggered by the content frame? If not, what is the recommend approach for something like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions