Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IFrame Question 2

Status
Not open for further replies.

klaforce

Programmer
Mar 25, 2005
124
0
0
US
Hi,
What I have setup is a page (index.htm) with a menu system and an iframe in the middle of the page. By clicking links in the menu it changes the page in the IFrame. My question is, is there a way to scroll the parent (index.htm) scroll bar up in IE? My problem occurs on an especially long page when you have to scroll down using the parent scrollbar, but when you change pages, the parent scroll bar is still 'down' causing user problems. Thus, is there a way to make that scroll back up when I change pages? Thanks for any help, and let me know if this is unclear.


Keith


The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
 
IE has the scroll, scrollTo, and scrollIntoView methods, but they all state that "There is no public standard that applies to this method.", which usually means they are IE-only. You might try them under Mozilla and see which one(s) work.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
How can the user click the menu when the page is scrolled down? Is the menu in another page?

Maybe you could use the #top in your menu. I assume there is an 'onclick' event somewhere. Just in my own words (not realy js)

Code:
onclick="
iframe.src='bla'; //set the source for the iframe
document.location=document.URL+'#top'; //set the url for the document

Hope this will help


[/code]
 
Hi Tracy,
Thanks for your help. That seems like the right solution. We don't have to worry about Firefox because it is an intranet site. Thanks again.


Keith


The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
 
Hi Recor, Sorry you must have posted while I was writing mine, and I missed it. That would be a good solution, but I did not explain the situation better. The page change actually occurs inside the IFRAME, not through the menu system. So what I will do (using ColdFusion) is put a tag on the cfm page that causes it to scroll up using scrollTop. Thank you for your reply though.



Keith


The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top