2

I'm making a web page with Muse.

How do I modify the structure of the iframes or just the scrollTop?

The iframe is called "booking_iframe". It's inside a regular Adobe Muse web page. Inside this iframe I load a PHP file which tries to change the height of the iframe and scroll it to top.

I read that jQuery loads at the end of Muse web pages and jQuery is not possible to use as .ready. I fixed that with a widget, although I haven't tried it yet for what I want.

<body onLoad="resize();">

Like this I don't need to use $(document).ready(); which doesn't work because of the reason I described before.

function resize(){
        $("html, body").scrollTop(0,0); // this doesn't work
        var testo = parent.document.getElementById("booking_iframe");
        testo.contents().scrollTop(0,0);
        testo.scrollTop(0,0); // this either
        $(document).scrollTop(0,0);
        window.scrollTop(0,0);  
    }
Community
  • 1
  • 1
juanma
  • 85
  • 1
  • 9

1 Answers1

0

And the solution is!!!

$('html,body', window.parent.document).animate({ scrollTop: $('#plantrip_init', window.parent.document).offset().top }, 0);

You need to control the parent of the webpage, and point it to the primary anchor on the top or whatever other div on the top!!

3 hours stock!!! good mu bien!

juanma
  • 85
  • 1
  • 9