Scrolling iframes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    Scrolling iframes

    Hi guys,
    I don't want to use iframes, but it is really the principle that I am going with. I want to have a frame with another website in and basically show a pre-determined part of that page (via scrolling). I have been trying all night to get a simple script going and I was wondering what I am doing wrong. Here is my code:
    Code:
    <script type="text/javascript">
    	function scroller() {
    		document.getElementById('myiframe').scroll(100,0);
    	}
    </script>
    <body onload="scroller()">
    	<iframe id="myiframe" scrolling="yes" height="500px" width="1000px" src="http://mytarget.com/"></iframe>
    </body>
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    in case the page that is loaded into the iframe is not from your domain you cannot control it by a script due to the XSS (cross-site-scripting) security restrictions ... have a look here

    Comment

    • TheServant
      Recognized Expert Top Contributor
      • Feb 2008
      • 1168

      #3
      THanks mate. I managed to do a work around with some CSS magic ;)

      Comment

      Working...