IFram onload

Hi,

i need to set scrollTo(0,0) each time iframe is loaded. i don't want to use html iframe onload since our cms deleted it. is there any alternative to do that ?
Sh_RashedAsked:
Who is Participating?
 
ahoffmannCommented:
in the page loaded with your iframe you have (somewhere right after the body tag):

<.body><.a name="top">

then you use your iframe like:

<.iframe src="path/to/page.html#top" />

(please remove the . dot)

Standard since 1993 ;-)
0
 
ahoffmannCommented:
why not simply define an anchor and add it to the iframe's src URL?
0
 
Sh_RashedAuthor Commented:
umm how would i do this ?
0
 
Sh_RashedAuthor Commented:
i have to put this code in every page that will be loaded in the iframe?
coz when i click a link in th iframe and open it in the iframe  the browser scroll doesn't move
0
 
ahoffmannCommented:
> .. when i click a link in th iframe
are you talking about A tags in the loaded page, then it's the responsibility of that link
but if it doesn't have a (anchor)fragment it loads with visibility from top anyway (unless some more or less sophisticated active scripting in there does something different)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.