Problem with iframe with url ending with sharp # unwanted scrolls main page

Hello all, I don’t know if you can help me, my problem is somewhat unusual:

I have a long page here: http://april-calendar.com

I have an iframe in the middle of the page, the url is from wikipedia, ending with a #Something and so it scrolls the iframed page to the approriate anchor.

The problem is that when the iframed page scrolls to the anchor, the main page also scrolls down to the middle of the page to show the iframe.

At the moment I have tried to solve the problem by called a function in the onload of the iframe, this function scrolltotop the main page.

The result is that the main page loads, the iframed page loads, then suddenly the main page scrolls to the iframe, my function scrolls the main page back to the top.

So you see a glitch happening at some point, very quickly. That’s one problem. Another problem with this solution is that when you go to the main page and start scrolling down before the iframe finished loading you are then taken to the iframe and back to the top, not user friendly.

Now I’ve also noticed another problem, more important, sometimes the main page doesn’t scroll back to the top, so the page stay at the iframe level (middle of page)


I would like a simple solution if possible, like the main page not jumping to the iframe in the first place. Is that possible with an attribute in the iframe code?

Note that I don’t have access to the iframed page since it’s wikipedia’s.

Thank you for any help you can give me on this very particular problem to which I found no acceptable solution by googling it.

****ing slapster, you dare spamming my thread where it’s already very difficult to get an answer, i hope you die for what you’ve done.

Is it legal for you to be embedding those pages within an IFRAME?

It makes sense the IFRAME would get focus; as it is the last content to load and web-pages by default load linearly. That is the expected behaviour and follows the rules of reiteration and hence why it jumps back up to the parent page.

As for a solution I don’t really know; as inline-frames are “problematic” but it would have to involve complex scripting.

Hello, I think it is legal, I haven’t noticed any problem regarding using iframe in Wikipedia Terms of Use : http://wikimediafoundation.org/wiki/Terms_of_Use

I’m not even parsing any text and republishing it like it is allowed, simply displaying their page in an iframe.

My solution at present like I said is to use a function in the iframe’s onload which takes the main page back to the top. It works in most cases when I test it in different browsers, but sometimes it doesn’t and I don’t know if it has to do with the speed of my internet connection and if wikipedia’s page is already in my browser cache or not.

Anyway thank you for your reply. I’m aware that it is a very specific problem and I didn’t expect people to have had the case before, because this behavior is happening because the iframed page jumps to another part of the page, it doesn’t happen when you simply embed a page in iframe which doesn’t jump to another part of the document. So this case is very rare.

I asked the same question in the relevant category on DigitalPoint and got no answers, so thank you for trying to think about my problem xhtmlcoder.