Skip links and iframes
Does anyone know how to make a "skip to main content" link work when the main content it's pointing to is in an iframe?
Did you get an answer to this? I see you also tweeted it, as did we... obviously a slightly tricky one.
James Coltham - Local gov web manager by day, web and accessibility blogger at lunchtime, freelancer by night. Tweets at @prettysimple.
James Coltham - Local gov web manager by day, web and accessibility blogger at lunchtime, freelancer by night. Tweets at @prettysimple.
No James, unfortunately no replies yet. I expect they could create a JavaScriptt skip link, which might actually work better in some browsers, but I haven't tried it. And of course doing it that way would break progressive enhancement.
Does the main content start immediately within the iframe? If so, I suppose you could skip to a point just before the iframe?
James Coltham - Local gov web manager by day, web and accessibility blogger at lunchtime, freelancer by night. Tweets at @prettysimple.
James Coltham - Local gov web manager by day, web and accessibility blogger at lunchtime, freelancer by night. Tweets at @prettysimple.
That's not a bad compromise James. I'll suggest they remove the iframe altogether, but if that's not possible they can point the skip link at a heading just before the iframe begins. Cheers.
If the iframed page is on the same domain, you can run Javascript inside the iframe and use scrollTo(). You may also be able to update the src attribute of the iframe to include the anchor, e.g., src="iframed_page.html#anchor"
Cheers Luke. I'll play around with your ideas and see what works.



