Log in

View Full Version : An IFrame Challenge!



bovels
06-25-2005, 03:21 PM
Hi Guys,

Hopefully someone knows a solution to this IFrame obstacle I have on my web page.

This is what I have posted:

<div class="pad5tb"><iframe src='http://sanfrancisco.giants.mlb.com/NASApp/mlb/mlb/news/boxscore.jsp?gid=2005_06_24_sfnmlb_oakmlb_1&c_id=sf' width='757' height='148' frameborder='0' scrolling='no' border='0'></iframe></div>

Where readers of my web page can see last night's box score of SF Giants. The problem is that the IFrame starts in the upper left corner of the source, where you see the MLB logos +++. My goal is to just show the box score, which means I need the iframe to scroll down some 110px. As it is now, you would have to scroll down manually.

Does any of you wizzards know a way to automatically scroll down the iframe source a certain amount of px?

Thanks a lot!
-Bovels

jscheuer1
06-25-2005, 06:27 PM
I'm not sure if this will work but, first of all, consider that you cannot change the scroll position of an external page that you have no access to. With that in mind, I'd try putting the external page in an iframe with width and height set to width="100%" height="2000" or some such thing and scrolling="no". Have this iframe be on a separate page with the body tag on that page looking something like this:
<body onload="window.scrollTo(0,x)">Where x is how far down you want it to scroll. Put this page in your original iframe.

bovels
06-25-2005, 09:02 PM
WOW, you are amazing!! it works!! thank you. the only change I had to make was to ad an ; between x) and ">

have a great day my friend!

-b

indoguy
10-11-2005, 01:41 PM
This was great! But I have one more wish. The thing is that I'm a reseller for something. I want to show something from the wholesaler's homepage but I can absolutely not let anyone see where it comes from. With above method, there is a natural delay on the scrollto operation (while the page is loading) when the header and logo of the wholesaler's company is clearly seen during a couple of seconds before it scrolls to desired position. I cannot have it like this. Could I somehow slow down the iframe on my homepage while the first iframe is loading...? or make the viewing progressive...?