473,513 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does my page scroll down when the iframe loads to an anchor point?

2 New Member
Hi, I'm new here.

I'm teaching my self to write a web site to help my sister's new business. It's in a three column format.

I put an small iframe on the main page's right column to show her blog, and I put in an anchor point (#iframe_target) in the blog so that the iframe shows the beginning of the content of the blog rather than the top left corner:
Expand|Select|Wrap|Line Numbers
  1. <iframe  
  2. src="http://DOMAIN.blogspot.com#iframe_target" width="215" height="287"><p>Your browser does not support iframes.</p></iframe>
  3.  
Once I added this I now get that the whole webpage loads, then as soon as the iframe content loads, it scrolls up (about the same amount as the iframe content scrolls up, I think, but haven't verified).

Can anyone explain what is happening? And better yet, give me idea how to fix either the initial problem (load the iframe content to the specific part of the webpage I want to show) or the subsequent problem (page scrolls up when iframe content loads)

I have one fix, which is to use the following function
Expand|Select|Wrap|Line Numbers
  1. function jumpScroll() {
  2.        window.scroll(0,0); 
  3. }
  4.  
and then use it as follows:
Expand|Select|Wrap|Line Numbers
  1. <body onload="javascript:jumpScroll()" >
  2.  
But this means the page loads, scrolls up and scrolls down, and is just messy and inelegant.

Any help will be greatly appreciated!
Aug 7 '10 #1
4 13775
johny10151981
1,059 Top Contributor
src="http://DOMAIN.blogspot.com#iframe_target"

remove the bold text from your link. its causing the page to do down
Aug 7 '10 #2
cvermar
2 New Member
Thanks, johny10151981.

I know that adding #iframe_target caused the problem, but the reason I put it in is that I wanted the iframe to open not showing the top left corner of the blog (since the iframe is a small one on the side of the main page, and all you see is boring white space), and it makes no sense to me that if you load a webpage in an iframe at some anchor point then the main page somehow scrolls down.

So if I remove it, I fix the second problem, but I'm back to my first one, which is to load the iframe content to the specific part of the blog I want to show rather than default top left corner. Is there an alternative way of doing that without making the main page scroll? Also, *why* does the main page scroll up like that?
Aug 8 '10 #3
johny10151981
1,059 Top Contributor
Now, i need to see the page. Without seeing cant help you :(
Aug 9 '10 #4
sguggen
1 New Member
@johny10151981


THANK YOU!!!! I'm not the initial asker but I've been looking for a solution to this for days and I just KNEW it was something really simple. You saved me life!!!
Jan 18 '16 #5

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

Similar topics

1
1811
by: Malkalypse | last post by:
Hello, I have been having some trouble with this one, so I decided to strip it down to its simplest form. I think I found the root of the problem, but I don't know how to solve it. I need a link...
5
2618
by: MacKenzieMouse | last post by:
Is there an easy way to have the page scroll to the next button? When I populate a drop down list box, I have to use the arrow key or the mouse to scroll down. I would like for the page to be...
2
10776
by: Craig Phillips | last post by:
Hi, Does anyone know how to programmatically move to a anchor point (a tag). I am using vb.net. When the user presses a server-side control on the webpage, I need to do some server processing and...
0
1389
by: Robert Fitzpatrick | last post by:
I am getting 'postmaster does not shut down' when trying to stop the database with '.../pg_ctl -D /path/to/datadir stop -m fast. How should I proceed to get the database shut down and restarted?...
1
1912
by: jadeite100 | last post by:
Hi: I have an pop-up window with an Iframe that has a text box with scrolldown. The scrolldown in the popup-window does not work but the scroll-down for the iFrame works. The strange thing is I...
1
3194
by: kallol | last post by:
I have a simple HTML page where I have a form with in a <div style="height: 600px; width: 100%; overflow: auto;">. The mentioned div styles are mandatory to get the expected behavior of the div. ...
2
12883
by: eddwinpaz | last post by:
Hi everyone..!! i have a chat and i want all the new messages to be seen but ecause i have a css iframe i would like to auto scroll down. so i can see the new message instead of click the scroller...
6
9775
by: deve8ore | last post by:
Hello, I've developed a form for users to enter in new info into an Access db. The form is very long, and everyone is used to scrolling down the page via the flywheel on the mouse, however when...
15
2125
Claus Mygind
by: Claus Mygind | last post by:
I have a <div> tag in my app that I minimize on the screen thereby only showing the top line of the content in that division. The user activates the content (maximizes the content) with the...
1
1231
by: Wayneyh | last post by:
Is there a way to change the content of a tables cell in the index.html when another webpage loads into an iframe on the index.html? I think it needs to use the OnLoad but i have no idea how to...
0
7267
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
7391
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
7553
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
7120
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
7542
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...
1
5100
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
3247
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
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
809
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.