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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IFRAME Premature Scrolling

Status
Not open for further replies.

Krus1972

Programmer
Mar 18, 2004
145
US
I am using an Iframe to show a portion of the contents from another one of my webpages. Right now when my main webpages loads, the IFRAME is not scrolled that is the right scrollbar is all the way to the top.

I would like the right scroll bar of my IFRAME to be scrolled down to a specified amount everytime when the main page loads. Could someone help me with a simple javascript that will allow me to specify and adjust exactly how far down the right scroll bar will be when the main page loads?

Thanks,

Jeff
 
Bookmarks won't work. I need to be able to tell the IFRAME how far to sroll the the right vertical bar onloading. This will require help with Javascript. Any ideas?

Thanks,

Jeff
 
Look at the scrollLeft, and scrollTop properties.
The code may need to reside in the page loading in the iframe, I have not tried it otherwise.

You specify the amount of scroll in pixels.
You can use scrollWidth and scrollHeight to determine how wide or tall the window is if you need to more accurately calculate the position to scroll to.



At my age I still learn something new every day, but I forget two others.
 
Guys,

This is what I have:

The page that loads into the IFRAME is called "thescript.asp" and contains the following:
<html>
<body>
<script src="</script>
</body>
</html>


The actual IFRAME page:
<html>
<body>
<iframe src="thescript.asp" marginwidth="1" name="pulse" marginheight="1" width="544" height="160" border="0" frameborder="0" ></iframe>
</body>
</html>


The main content comes from the javascript src= and I have no control over the content. Bookmarks won't work. I just want the Iframe to scroll down automatically. Any ideas?

Thanks,

Jeff
 
Code:
[i]Quote your original post[/i]
I am using an Iframe to show a portion of the contents from another one of [red]my[/red] webpages.
Your original post stated that it was one of your web pages but now you say you have no control over it, please clarify.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top