<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>absolute iframe content &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/absolute-iframe-content/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Scroll an IFRAME Content to a Predefined Position</title>
		<link>/2011/03/29/scroll-an-iframe-content-to-a-predefined-position/</link>
		<comments>/2011/03/29/scroll-an-iframe-content-to-a-predefined-position/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 11:43:36 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[absolute iframe content]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">/?p=2238</guid>
		<description><![CDATA[IFRAME Source Usually when you use an IFRAME tag to link an external source the page that&#8217;s referenced by the SRC attributes is loaded at the top left corner. This is the default behavior, but sometimes you&#8217;d like to show to your users not the entire page from the top left corner, but to show &#8230; <a href="/2011/03/29/scroll-an-iframe-content-to-a-predefined-position/" class="more-link">Continue reading <span class="screen-reader-text">Scroll an IFRAME Content to a Predefined Position</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/04/24/scroll-the-page-with-javascript/" rel="bookmark" title="Scroll the page with JavaScript">Scroll the page with JavaScript </a></li>
<li><a href="/2010/01/24/css-default-position-value/" rel="bookmark" title="CSS default position value">CSS default position value </a></li>
<li><a href="/2009/06/11/remove-iframe-border-on-ie/" rel="bookmark" title="remove iframe border on IE">remove iframe border on IE </a></li>
<li><a href="/2009/11/10/jquery-css-functions-part-1-offset/" rel="bookmark" title="jQuery CSS functions. Part 1 &#8211; offset()">jQuery CSS functions. Part 1 &#8211; offset() </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>IFRAME Source</h2>
<p>Usually when you use an <a href="/tag/iframe/">IFRAME</a> tag to link an external source the page that&#8217;s referenced by the SRC attributes is loaded at the top left corner. This is the default behavior, but sometimes you&#8217;d like to show to your users not the entire page from the top left corner, but to show only part of the external page instead.</p>
<p>In most of the cases the reference is external and you don&#8217;t have control over the external page. Thus you&#8217;ve to scroll the IFRAME content to the desired position. This of course is impossible. Yeah, there are some JavaScript hacks, but they&#8217;re all a bad solution, because the scrolling occurs only after the page is loaded.</p>
<h2>The Solution</h2>
<p>You can wrap the <a href="/tag/iframe/">IFRAME</a> into a div and scroll the DIV content using absolute TOP and LEFT <a href="/tag/css/">CSS</a> properties.</p>
<p>Here&#8217;s an example:</p>
<pre lang="css">
#my-div
{
    width    : 400px;
    height   : 200px;
    overflow : hidden;
    position : relative;
}

#my-iframe
{
    position : absolute;
    top      : -100px;
    left     : -100px;
    width    : 1280px;
    height   : 1200px;
}
</pre>
<p>Here you have one DIV with dimensions 400x200px. Now by moving the IFRAME within it you can position it on the right place.</p>
<pre lang="html4strict">
<div id="my-div">
<iframe src="http://www.example.com/" id="my-iframe" scrolling="no"></iframe>
</div>
</pre>
<p><span id="more-2238"></span><br />
Example with the awesome <a href="http://www.yahoo.com/" target="_blank" title="Yahoo! Homepage">Yahoo! Homepage</a>:<br />
<iframe src="http://stoimen.com/projects/iframe.scrolled.content/" scrolling="no" frameborder="0" style="width:400px;height:390px"></iframe></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/04/24/scroll-the-page-with-javascript/" rel="bookmark" title="Scroll the page with JavaScript">Scroll the page with JavaScript </a></li>
<li><a href="/2010/01/24/css-default-position-value/" rel="bookmark" title="CSS default position value">CSS default position value </a></li>
<li><a href="/2009/06/11/remove-iframe-border-on-ie/" rel="bookmark" title="remove iframe border on IE">remove iframe border on IE </a></li>
<li><a href="/2009/11/10/jquery-css-functions-part-1-offset/" rel="bookmark" title="jQuery CSS functions. Part 1 &#8211; offset()">jQuery CSS functions. Part 1 &#8211; offset() </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2011/03/29/scroll-an-iframe-content-to-a-predefined-position/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
	</channel>
</rss>
