Results 1 to 2 of 2

Thread: Scroll Iframe Down page

  1. #1
    Join Date
    Jan 2008
    Posts
    46
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Scroll Iframe Down page

    On my site i am displaying an external site in a frame e.g (www.wikipedia.org), i would like it to automatically scroll down half the page or a quarter of the page down, i cannot use anchors because it is a dynamic page, how can i do this.

    Thanks

  2. #2
    Join Date
    Feb 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This question can be addressed using JavaScript. And in particular the scrollBy(int horizontal, int vertical) method.

    Theoretically this code, should work (it does with Safari), but you would have to iron it out to have it work across browsers.

    Code:
    <body onload="window.frames['Wikipedia_Frame'].scrollBy(0, 800)">
    <iframe name="Wikipedia_Frame" id="Wikipedia_Frame" src="http://en.wikipedia.com" width="800" height="300">
    	Sorry, your browser doesn't support iframes.
    </iframe>
    </body>
    The window.frames['Wikipedia_Frame'].scrollBy(0, 800) call scrolls the Wikipedia_Frame down by 800 pixels.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •