Jump to content
Killersites Community

Iframe problem - Maybe a JS fix?

Recommended Posts

Iframe problem I am having. I inserted a Iframe on the main Index page and anchored the iframe so it would scroll to a certain part of page. I thought that was that but heres my problem!


When I enter the main index page it takes me down to the Iframe on Loading of Page/refresh and scrolls to anchored text in my iframe.


It makes my whole main index page scroll down to the Iframe and waits for the Iframe to scroll to the ancored text.


I want the main index page to stay at the top and not scroll down to the Iframe to watch it scroll itself.


Thanks in advance for all the generous help!

Share this post

Link to post
Share on other sites

Sounds like you have a #whatever at the end of your link? But first why do you have a iframe on your index page? Can you do the same without it?


Yeah the # is my anchor. I am starting to like it now the fact it gets pulled down so I left like this. Thanks for the help. I can do without out it buts its a way to get attention to another page.

Share this post

Link to post
Share on other sites

I can't really help you, but you can grab items inside an iframe using jQuery:


$('#element', $('iframe').get(0).contentDocument)


where #element is any selector relative to the html element inside the iframe. Try and experiment with this, maybe you will find a way. I would suggest instead of using #anchor on the iframe url, try and see if you can use jquery to scroll the iframe using jquery after page load.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now