PDA

View Full Version : Centering Iframe Content


Temper
06-05-2003, 01:49 AM
I have a website, and using Iframes I would like to load a submit button from a totally different website.
The size of the Iframe that I have the other website load into is 50x50, and the webpage that loads into it is 800x600. What I would like to do, is when the other website loads into the Iframe, instead of showing the top right corner it would center on this submit button by somehow using align commands (I don't want users to have to scroll around to find the button.)
I'm not sure if this question falls under this catagory, but any help you can give me would make me a very happy person.
Thank you.
~Mike

Spudhead
06-05-2003, 12:13 PM
And why would you want a form that appears to be on your site to submit a form that's actually on someone else's site?

Hmm?

Kor
06-06-2003, 11:09 AM
Try the external.NavigateAndFind method
Unfortunately it works only for IE 5 or higher

Syntax

external.NavigateAndFind(sLocation, sQuery, sTargetFrame)

Parameters

sLocation Required. String that specifies the URL of a Web page.

sQuery Required. String that specifies the text to highlight on the Web page specified by sLocation .

sTargetFrame Required. String that specifies the name of the target frame to query.

NOTE important :
This method requires a full qualified path, including a location prefix (http://, c:\, and so on).

The target frame argument might be empty.

here is an exemple, fill the url and text as u wish

<html>
<head>
<title></title>
<script language="JavaScript">

function findthat(){
window.external.NavigateAndFind("http://whicheversite.com","sometext","nameiframe");
}
</script>
</head>

<body onload="findthat()">
<iframe name="nameiframe" src="nomatterwhat.html" frameborder="NO" border="0" framespacing="0" noresize width="560"></iframe>
</body>
</html>