View Single Post
Old 06-12-2007, 12:28 PM   #2 (permalink)
Vormund
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: need a code that opens up a website in an iframe, and scrolls down to it

Hmm, how about...a simple link:
Code:
<a href="your link" target="your iframe" onclick="focusIframe();">Hello</a>
Then some JS (put this in the <head> or <body> area):
Code:
<script type="text/javascript">
  function focusIframe( ) {
    var theElement = document.getElementById( "your iframe id" );
    
    if ( document.all ) {
      // Internet Explorer
      theElement.document.body.focus( );
    } else {
      // Firefox
      theElement.contentDocument.body.focus( );
    }
  }
</script>
...with some credit due to the FF/IE differences here.

Just remember to set the id="your iframe id" attribute.

That might work, though it's pure speculation...
__________________
Vormund is offline