Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Jumping to anchor within a iFrame - without moving parent page

Reply
Thread Tools

Jumping to anchor within a iFrame - without moving parent page

 
 
Robert Mark Bram
Guest
Posts: n/a
 
      11-08-2005
Hi All,

We are using a scrolling iFrame to present a list of options to the
user within the main page with an anchor against each option. Depending
on the user actions, we jump to an anchor in the frame with code like
this:

theFrameSrc = theFrame.src;
theFrame.src = theFrameSrc + "#" + anchorName;

The issue is that when we jump to it, the parent document moves as well
i.e. the frame scrolls to bring the option to the top of the frame, but
then the main document scrolls to bring that option to the top of the
window.

Is there a way to turn off this second behaviour, so that only the
iFrame scrolls?

Any help would be most appreciated!

Rob


 
Reply With Quote
 
 
 
 
Gérard Talbot
Guest
Posts: n/a
 
      11-08-2005
Robert Mark Bram a écrit :
> Hi All,
>
> We are using a scrolling iFrame to present a list of options to the
> user within the main page with an anchor against each option. Depending
> on the user actions, we jump to an anchor in the frame with code like
> this:
>
> theFrameSrc = theFrame.src;
> theFrame.src = theFrameSrc + "#" + anchorName;
>
> The issue is that when we jump to it, the parent document moves as well
> i.e. the frame scrolls to bring the option to the top of the frame, but
> then the main document scrolls to bring that option to the top of the
> window.
>
> Is there a way to turn off this second behaviour, so that only the
> iFrame scrolls?
>
> Any help would be most appreciated!
>
> Rob
>


Providing the url to the actual page being developed is always a good idea.

<a href="[IframeURL].html#anchorName" target="IframeName">Some option</a>

There is always the possibility of using scrollIntoView(false) to
prevent the scrolling.

Gérard
--
remove blah to email me
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping Back Up??? dorayme HTML 3 05-03-2008 06:02 AM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted ASP .Net 0 01-06-2008 04:45 AM
Finding a text string on another page and jumping to it like an anchor dangonzale@gmail.com Javascript 2 07-21-2006 10:31 PM
jumping beens, well... jumping programs, aaahuuu-aah jalkadir C++ 3 10-05-2005 02:41 PM
iFrame Call to Parent Anchor Jeff Johnson Javascript 0 01-22-2004 10:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57