Connecting Tech Pros Worldwide Help | Site Map

Iframe scroll to anchor problem.

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 09:26 AM
splish
Guest
 
Posts: n/a
Default Iframe scroll to anchor problem.

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



  #2  
Old July 20th, 2005, 09:26 AM
DU
Guest
 
Posts: n/a
Default Re: Iframe scroll to anchor problem.

splish wrote:
[color=blue]
> 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
>
>[/color]

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

frames["FrameName"].document.getElementById("idAnchor").scrollIntoVie w(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/doctorunc...e7Section.html

  #3  
Old July 20th, 2005, 09:26 AM
splish
Guest
 
Posts: n/a
Default Re: Iframe scroll to anchor problem.

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" <drunclear@hotREMOVEmail.com> wrote in message
news:bga17q$haq$1@news.eusc.inter.net...[color=blue]
> splish wrote:
>[color=green]
> > 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[/color][/color]
though[color=blue][color=green]
> > there were an anchor at that point.
> >
> > HELP !!
> >
> > PS: This happens in IE, but is fine in NS.
> >
> > Splishman
> >
> >[/color]
>
> Give id to your anchors and use the scrollIntoView() method.
>
>[/color]
frames["FrameName"].document.getElementById("idAnchor").scrollIntoVie w(true)
;[color=blue]
>
> 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/doctorunc...e7Section.html
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.