Iframe scroll to anchor problem.

S

splish

Hello,
I have the following problem:

An Iframe exists inside a page (that has content exceeding the height,
therefore scrollbars kick in) - normal stuff.

When I want to use anchor references inside the Iframe the parent
page is affected also, in that it jumps to the top of the iframe, as though
there were an anchor at that point.

HELP !!

PS: This happens in IE, but is fine in NS.

Splishman
 
D

DU

splish said:
Hello,
I have the following problem:

An Iframe exists inside a page (that has content exceeding the height,
therefore scrollbars kick in) - normal stuff.

When I want to use anchor references inside the Iframe the parent
page is affected also, in that it jumps to the top of the iframe, as though
there were an anchor at that point.

HELP !!

PS: This happens in IE, but is fine in NS.

Splishman

Give id to your anchors and use the scrollIntoView() method.

frames["FrameName"].document.getElementById("idAnchor").scrollIntoView(true);

will work in MSIE 6 for Windows, NS 7.1 and Mozilla-based browsers.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 
S

splish

Thanks for the effort DU but it hasn't changed things for me.
It is producing the same effect as just linking to the anchor.
The parent page JUMPS to the top of the IFRAME instead of
just leaving itself in its current position.

Splishman


DU said:
splish said:
Hello,
I have the following problem:

An Iframe exists inside a page (that has content exceeding the height,
therefore scrollbars kick in) - normal stuff.

When I want to use anchor references inside the Iframe the parent
page is affected also, in that it jumps to the top of the iframe, as though
there were an anchor at that point.

HELP !!

PS: This happens in IE, but is fine in NS.

Splishman

Give id to your anchors and use the scrollIntoView() method.

frames["FrameName"].document.getElementById("idAnchor").scrollIntoView(true)
;

will work in MSIE 6 for Windows, NS 7.1 and Mozilla-based browsers.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunclear/Netscape7/Netscape7Section.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top