Forum Moderators: open

Message Too Old, No Replies

IFRAME to specific external position

<iframe> (<div>? other?) to capture a section of external content?

         

jmorga

10:07 pm on Jan 17, 2008 (gmt 0)

10+ Year Member



Is it possible to iframe an external page to a specific spot and size on the external page?

1) Let's say my browser will have an iframe that's in the dead-center of my local webpage. And it's location is fixed.

2) The area I want to frame on the external page will always be in the same location (pixels from left, pixels from top), and will always be the same size (width pixels & height pixels)

3) The external page would somehow have to load with a negative top and left offset so the underlying content "lands" exactly in my frame or window.

Is this possible?

thanks!
jmorga

[edited by: tedster at 11:18 pm (utc) on Jan. 17, 2008]
[edit reason] no urls, thanks [/edit]

eelixduppy

11:56 pm on Jan 20, 2008 (gmt 0)



Welcome to WebmasterWorld!

I do not think that this is possible, and even if it is it probably wouldn't work across different browsers and resolutions. If you can, you might be able to write a server-side script that retrieves the data that you are looking for and print it to the browser. I guess it all depends on what you are looking to retrieve from the external site, though.

wrgvt

4:13 pm on Jan 21, 2008 (gmt 0)

10+ Year Member



I do this sort of thing. I have a small iframe window, though, and that may make the difference. My web pages have a fixed size, and I have an absolutely positioned unique div for the iframe content. The css for the div will position it wherever I want. For example, top:40px; left:100px; height:50px; width;100px and the iframe window is 50x100.

jmorga

4:40 pm on Jan 21, 2008 (gmt 0)

10+ Year Member



wrgvt, yes! that's it. thank you :-)

for example here --> pulling the radar off intellicast.com (which is always exactly in the same place). Just paste in the source site and fiddle with the settings.

#outerdiv
{
width:756px;
height:496px;
overflow:hidden;
position:relative;
}

#innerIframe
{
position:absolute;
top:-546px;
left:-349px;
width:1280px;
height:1200px;
}

<div id='outerdiv'>
<iframe src="http://www.intellicast.com/National/Radar/Current.aspx?location=USNY0850&animate=true" id='innerIframe' scrolling=no></iframe>
</div>

eelixduppy

7:25 pm on Jan 21, 2008 (gmt 0)



Nice one :)