473,508 Members | 3,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Anchor link in iframe makes parent page scroll too

49 New Member
I have an iframe in a page (with a name to the iframe), and in that iframe I have several anchors

Expand|Select|Wrap|Line Numbers
  1. <a name="something">
There are links in the iframe that look like

Expand|Select|Wrap|Line Numbers
  1. <a href="#something">
The problem is, when any of these links is clicked, along with the iframe, the parent page scrolls up too to the beginning of the iframe.

I tried this, doesn't work:

Expand|Select|Wrap|Line Numbers
  1. <a href="#something" target="the_iframe_name">
Does anyone know a solution? Thank you very much for your time.
Aug 8 '07 #1
2 3624
epots9
1,351 Recognized Expert Top Contributor
are u closing your tags?
[html]
<a href="#something">go to something</a>
<a name="something">about something</a>
[/html]
Aug 8 '07 #2
knkk
49 New Member
Sorry for the delayed response. Yes, I was closing the tags.

I could not solve this problem using anchors, so I found a different way - I kept track of the x,y co-ordinates of the scroll position of the page (where the anchor would have been) and used the javascript scrollTo(x,y) instead to go to that part when the "a href" was clicked on.
Aug 12 '07 #3

Sign in to post your reply or Sign up for a free account.

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...
3
9289
by: Catherine Lynn Smith | last post by:
I want to know the recommended way to handle scripting of/with containers such as an iframe. I have a page with border-navigation bars on the top/bottom/left/right and I want to use an iframe to...
4
5027
by: catyionic | last post by:
Greetings: I have numerous links on index.html...example of one..... <A HREF="stage.html#Flash" target="left">Flash</A> It connects to page named stage.html ... which contains... <a...
1
6213
by: Robert Mark Bram | last post by:
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...
1
5376
by: axlq | last post by:
I'm trying to figure out how to make javascript set the scroll position of a page to an anchor that's specified in the page URL. You may ask, why? Doesn't the browser go there anyway when the...
0
2594
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...
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'" ...
1
7725
by: praveenb000 | last post by:
Hi every one, I designed a web page, having horizontal menu using UL and LI tags; I need to be set rollover effect for a menu items. whenever user hover on a menu item, the entire...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7332
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,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
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
7502
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
5635
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
5057
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
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.