473,505 Members | 13,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jumping to anchor within a iFrame - without moving parent page

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
:)

Nov 8 '05 #1
1 6211
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
Nov 8 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
16539
by: splish | last post by:
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...
17
1627
by: compassSoftware | last post by:
Hi, I have two horizontal frames, one on top of the other. The top frame is an image map of a street with property boundary's on it. The bottom frame is a table with each row of the table...
1
4445
by: k.roemke | last post by:
Hello! After a longer time I want to do some javascript again. Task: set content of an iframe to the origin page if the mouse is not moved Problem: <iframe onmousemove="resetCounter();return...
3
3322
by: Jeremy | last post by:
If we have an iframe loaded from the same domain as the parent document, how can we (is it possible) to execute a function on the parent document's page? e.g. 1) On parent page:...
2
3624
by: knkk | last post by:
I have an iframe in a page (with a name to the iframe), and in that iframe I have several anchors <a name="something"> There are links in the iframe that look like <a href="#something"> ...
0
2593
by: LudwigWrules | last post by:
I have an iframe on my site. I need the frame to display its "child" page at a specific point. I can do this by setting an anchor, but it makes the parent window go there, too. I was thinking of just...
0
5440
by: oopaevah | last post by:
Hi, I have a set of valid xhtml pages that a third party web site is integrating with via an <iframein his own page. This retains his own branding template in the header and footer, with the...
11
4043
by: nma | last post by:
Hi How can I make the anchor link once I do onclick? <td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#00ff00" onMouseOver="this.style.background ='red'" ...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.