473,672 Members | 2,712 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 13823
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
1819
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 in one iframe to open a page in a different iframe. I can do this normally: http://www.jonesmfgmusic.com/test/test1/ But, when the iframes are dynamically generated (created via a
5
2625
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 positioned at or near the bottom. I have turned smart navigation on. That helps, but still isn't enough. Thanks
2
10788
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 then I would like the resultant page to have scrolled down half-way to the relevent part. Any help much appreciated.
0
1406
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? Are there other options besides immediate shutdown flag? I dont' want to lose everything I've worked on today :( -- Robert
1
1925
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 have another html page that is a popup-window and the text box scroll-down for the iFrame works and so does the scroll-down for the outer window. I just can't tell what are the differences. I am using IE 6, sp2.
1
3205
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. Now, in Firefox, the page appears properly as expected. I can scroll down and up the div part by dragging the scroll bar by mouse and I can scroll down and up the div part by rolling up and down the mouse wheel as well. But I am facing the problem...
2
12904
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 and scroll down.. it takes time . and i dont really like that idea.. Does some one knows how to do that ? tachiracompras.com/chat/ see the actual chat.
6
9787
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 doing this it does NOT scroll down the form, it actually goes to the next record. Does anyone know how to turn this function off and just allow the Flywheel to scroll down the page rather than going to the next record? Any help would be...
15
2143
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 mouseover event. When active the user can scroll down through the content and mouseout minimizes it again. My problem is this - when the content is minimized to reveal only one line, it is at the point where the user had scrolled to. I would like...
1
1235
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 put the code together.
0
8502
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8418
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8943
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8638
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8696
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5720
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2836
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 we have to send another system
2
2089
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1834
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.