0

To start, I know people hate frames, however it is the least energy for best result for pages I have no control over.

Just an example:

<html>
<head>
<title>Test Page</title>
<script type="text/javascript">
    function scrollFrame() 
    {
        document.frames["HOME"].scrollTo(0,90);
        document.frames["VIDEO"].scrollTo(0,90);
        document.frames["APPS"].scrollTo(0,90);
    }
</script>
</head>

<frameset rows="30%,30%,*">
    <frame name="HOME" src="www.cwtv.com" scrolling="auto" frameborder=0 />
    <frame name="VIDEO" src="www.cwtv.com/cw-video" scrolling="auto" frameborder=0 />
    <frame name="APPS" src="www.cwtv.com/apps" scrolling="auto" frameborder=0 />
</frameset>
  <body onLoad="scrollFrame();">
  </body>
</html>

I have no idea how to incorporate the scrollFrame function into the frame, if that is even possible.

EDIT: I have added the scrolls statically to the JavaScript function and am now attempting to call them directly from an empty body. I also put the example URLs in the same domain.

I'll accept any help provided, just remember I will have no control over the sources.

Appreciate the help!

krmarshall87
  • 191
  • 2
  • 9
  • The frameset page itself is supposed to be `parent`, hence just remove `parent`. Then I think it depends on browser. Some have `window.scrollTo()`, some have `document.body.scrollTo()`... And ofcourse, as stated by LcSalazar, all pages have to be within the same domain. – Teemu Sep 10 '14 at 15:41
  • 1
    Since `frameset` is long gone, I can't be sure how it works on frames. But, I assume it will adopt the same rules as `iframes` when it comes to *cross-domain* pages... Since you're trying to interact with pages that are not in your domain, I'm pretty sure that you'll be very limited on what you can do... I don't think you will be able to scroll it... – LcSalazar Sep 10 '14 at 15:42
  • Also, take a look at `iframe`. It takes even "less energy" than building a frameset... https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe – LcSalazar Sep 10 '14 at 15:45
  • Ok let's assume same domain. IE11 interprets frameset for now, but I can modify and investigate further into iframe. I also wasn't quite sure how to call the function. – krmarshall87 Sep 10 '14 at 16:06
  • @krmarshall87 Please check [this answer](http://stackoverflow.com/a/24096958/1169519), there's some useful information about `(i)frames`. – Teemu Sep 10 '14 at 16:51

0 Answers0