<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Nicely-Fitting Background Images</title>
	<atom:link href="http://www.search-this.com/2008/06/17/nicely-fitting-background-images/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/</link>
	<description>Internet Marketing, Website Promotion and Blogging Advice</description>
	<lastBuildDate>Sun, 29 Jan 2012 02:18:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Alex</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-166181</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 17 May 2010 19:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-166181</guid>
		<description>Hello,
sometimes I have to reload the page before the image is displayed correctly. Is this a know issue= How can I solve this problem?</description>
		<content:encoded><![CDATA[<p>Hello,<br />
sometimes I have to reload the page before the image is displayed correctly. Is this a know issue= How can I solve this problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad Shaw</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-156778</link>
		<dc:creator>Brad Shaw</dc:creator>
		<pubDate>Mon, 14 Dec 2009 07:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-156778</guid>
		<description>Thanks for that Raffles. Yes, this worked, but you also need to change overflow from hidden to visible on the html, body.

Amazingly enough this script seems to dodge the Firefox scrolling bug over fixed background images too.

Cheers.</description>
		<content:encoded><![CDATA[<p>Thanks for that Raffles. Yes, this worked, but you also need to change overflow from hidden to visible on the html, body.</p>
<p>Amazingly enough this script seems to dodge the Firefox scrolling bug over fixed background images too.</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raffles</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-156754</link>
		<dc:creator>Raffles</dc:creator>
		<pubDate>Sun, 13 Dec 2009 12:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-156754</guid>
		<description>@ booyah:

The jumping in scale happens because bgimg.src is set before the resizing happens. If you want to hide it beforehand, then you simply have to toggle the display property:

#bg img {display:none}

Then add this right at the end of the resizeBg function:

bgimg.style.display = &#039;block&#039;;

@ Christiaan:

Yes, it would certainly be easy enough to do. All you would have to do whenever you want the image to change is:

1. Make sure the image is preloaded
2. Hide the image
3. Change the src attribute
4. Run the resizeBg function
5. Show the image

It might require a second holder DIV, as this procedure might cause a nasty flash of emptiness.

You could even add a nice fading transition between the two images.

@ Brad

I hadn&#039;t thought of that. The solution is to do the following:

#bg {position:fixed}</description>
		<content:encoded><![CDATA[<p>@ booyah:</p>
<p>The jumping in scale happens because bgimg.src is set before the resizing happens. If you want to hide it beforehand, then you simply have to toggle the display property:</p>
<p>#bg img {display:none}</p>
<p>Then add this right at the end of the resizeBg function:</p>
<p>bgimg.style.display = &#8216;block&#8217;;</p>
<p>@ Christiaan:</p>
<p>Yes, it would certainly be easy enough to do. All you would have to do whenever you want the image to change is:</p>
<p>1. Make sure the image is preloaded<br />
2. Hide the image<br />
3. Change the src attribute<br />
4. Run the resizeBg function<br />
5. Show the image</p>
<p>It might require a second holder DIV, as this procedure might cause a nasty flash of emptiness.</p>
<p>You could even add a nice fading transition between the two images.</p>
<p>@ Brad</p>
<p>I hadn&#8217;t thought of that. The solution is to do the following:</p>
<p>#bg {position:fixed}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-156637</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Thu, 10 Dec 2009 15:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-156637</guid>
		<description>Hi there. This looks like an amazing bit of script, but one thing is stumping me and that is how to get long content to scroll. Do you have any possible solutions for this or am I just missing the obvious perhaps?

Any help would be greatly appreciated!</description>
		<content:encoded><![CDATA[<p>Hi there. This looks like an amazing bit of script, but one thing is stumping me and that is how to get long content to scroll. Do you have any possible solutions for this or am I just missing the obvious perhaps?</p>
<p>Any help would be greatly appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christiaan</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-150111</link>
		<dc:creator>Christiaan</dc:creator>
		<pubDate>Fri, 21 Aug 2009 08:20:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-150111</guid>
		<description>Hey Raffles, this is an awesome thing. It works like a charm, and with a bit of tweaking from my end, now it also looks graphically very well. 

However.. I have one question, being: is it possible to make the script more dynamic? The reason is that I would like to use this as a base of an image gallery, and when a new image is clicked, the background changes. Do you reckon this is possible??

Cheers, thanks for the great script Raffles.</description>
		<content:encoded><![CDATA[<p>Hey Raffles, this is an awesome thing. It works like a charm, and with a bit of tweaking from my end, now it also looks graphically very well. </p>
<p>However.. I have one question, being: is it possible to make the script more dynamic? The reason is that I would like to use this as a base of an image gallery, and when a new image is clicked, the background changes. Do you reckon this is possible??</p>
<p>Cheers, thanks for the great script Raffles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GammyKnee</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-145650</link>
		<dc:creator>GammyKnee</dc:creator>
		<pubDate>Fri, 12 Jun 2009 09:18:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-145650</guid>
		<description>Thank you Mr. Raffles! 

You&#039;d think that stretching an image to make best use of available space would be a really common requirement, well served with examples on just about every decent coding site. Not so! Yours is the only one I&#039;ve found that actually does what I need.</description>
		<content:encoded><![CDATA[<p>Thank you Mr. Raffles! </p>
<p>You&#8217;d think that stretching an image to make best use of available space would be a really common requirement, well served with examples on just about every decent coding site. Not so! Yours is the only one I&#8217;ve found that actually does what I need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: booyah</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-130139</link>
		<dc:creator>booyah</dc:creator>
		<pubDate>Tue, 03 Mar 2009 02:57:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-130139</guid>
		<description>update:
the jumping in scale happens in all OSs and browsers, not just mac. thanks.</description>
		<content:encoded><![CDATA[<p>update:<br />
the jumping in scale happens in all OSs and browsers, not just mac. thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: booyah</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-130138</link>
		<dc:creator>booyah</dc:creator>
		<pubDate>Tue, 03 Mar 2009 02:52:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-130138</guid>
		<description>this works great, but have one question.
on a mac, you can see that it loads the whole image first before it resizes it. in other words, you see the image at full scale, then it immediately scales down to the browser.

is it possible to resize the image before you see anything so that you don&#039;t see that jumping in scale of the image?
thanks!</description>
		<content:encoded><![CDATA[<p>this works great, but have one question.<br />
on a mac, you can see that it loads the whole image first before it resizes it. in other words, you see the image at full scale, then it immediately scales down to the browser.</p>
<p>is it possible to resize the image before you see anything so that you don&#8217;t see that jumping in scale of the image?<br />
thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: king27</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-125942</link>
		<dc:creator>king27</dc:creator>
		<pubDate>Sun, 01 Feb 2009 17:25:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-125942</guid>
		<description>Very very good :)
Thankssssssssss Raffles :D
Now run cross-browser ;)
Yo!</description>
		<content:encoded><![CDATA[<p>Very very good <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thankssssssssss Raffles <img src='http://www.search-this.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Now run cross-browser <img src='http://www.search-this.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Yo!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raffles</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-125927</link>
		<dc:creator>Raffles</dc:creator>
		<pubDate>Sun, 01 Feb 2009 13:47:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-125927</guid>
		<description>Yes, in the JavaScript. The files have been updated, so just look at the &lt;a href=&quot;http://www.search-this.com/wp-content/uploads/2008/06/fsbg.html&quot; rel=&quot;nofollow&quot;&gt;sample HTML&lt;/a&gt; and &lt;a href=&quot;http://www.search-this.com/wp-content/uploads/2008/06/fsbg.js&quot; rel=&quot;nofollow&quot;&gt;JS&lt;/a&gt; files for the code. I&#039;ve tested in FF2/3 and IE6/7 and they work.</description>
		<content:encoded><![CDATA[<p>Yes, in the JavaScript. The files have been updated, so just look at the <a href="http://www.search-this.com/wp-content/uploads/2008/06/fsbg.html" rel="nofollow">sample HTML</a> and <a href="http://www.search-this.com/wp-content/uploads/2008/06/fsbg.js" rel="nofollow">JS</a> files for the code. I&#8217;ve tested in FF2/3 and IE6/7 and they work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: king27</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-125656</link>
		<dc:creator>king27</dc:creator>
		<pubDate>Fri, 30 Jan 2009 07:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-125656</guid>
		<description>Hey Raffles :)

a mistake in the CODE?!

but... have you modify some code lines?!

and now?! It run correctly both in Firefox and in IE 6/7 ? :)

yo!</description>
		<content:encoded><![CDATA[<p>Hey Raffles <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>a mistake in the CODE?!</p>
<p>but&#8230; have you modify some code lines?!</p>
<p>and now?! It run correctly both in Firefox and in IE 6/7 ? <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>yo!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raffles</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-125622</link>
		<dc:creator>Raffles</dc:creator>
		<pubDate>Thu, 29 Jan 2009 22:08:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-125622</guid>
		<description>There was a mistake in the code that stopped it working in IE6, should be all OK now.</description>
		<content:encoded><![CDATA[<p>There was a mistake in the code that stopped it working in IE6, should be all OK now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: booyah</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-125430</link>
		<dc:creator>booyah</dc:creator>
		<pubDate>Wed, 28 Jan 2009 07:12:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-125430</guid>
		<description>Has anyone gotten this to work in ie 6/7 and firefox 2?
Can&#039;t seem to figure it out.</description>
		<content:encoded><![CDATA[<p>Has anyone gotten this to work in ie 6/7 and firefox 2?<br />
Can&#8217;t seem to figure it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: king27</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-82208</link>
		<dc:creator>king27</dc:creator>
		<pubDate>Fri, 08 Aug 2008 08:00:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-82208</guid>
		<description>Hi all :)
i m new to this pages :)
im interesting in this great script to fit background :)

i have the same IE6 / 7 problems... on line 38/39 (readyState)!

i ve written down a correct code but... no reason!!! :( ...

the code (from Firefox to Explorer lines):

var alreadyrunflag=0; //flag to indicate whether target function has already been run

if (document.addEventListener)
  document.addEventListener(&quot;DOMContentLoaded&quot;, function(){alreadyrunflag=1; init();}, false)
else if (document.all &amp;&amp; !window.opera){
  document.write(&#039;&#039;)
  var contentloadtag=document.getElementById(&quot;contentloadtag&quot;)
  contentloadtag.onreadystatechange=function(){
    if (bgimg.readyState==&quot;complete&quot;){
      alreadyrunflag=1;
      init();
    }
  }
}

window.onload=function(){
  setTimeout(&quot;if (!alreadyrunflag){init();}&quot;, 0)
}


any reason ? :)

yo!

Roby</description>
		<content:encoded><![CDATA[<p>Hi all <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
i m new to this pages <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
im interesting in this great script to fit background <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>i have the same IE6 / 7 problems&#8230; on line 38/39 (readyState)!</p>
<p>i ve written down a correct code but&#8230; no reason!!! <img src='http://www.search-this.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  &#8230;</p>
<p>the code (from Firefox to Explorer lines):</p>
<p>var alreadyrunflag=0; //flag to indicate whether target function has already been run</p>
<p>if (document.addEventListener)<br />
  document.addEventListener(&#8220;DOMContentLoaded&#8221;, function(){alreadyrunflag=1; init();}, false)<br />
else if (document.all &amp;&amp; !window.opera){<br />
  document.write(&#8221;)<br />
  var contentloadtag=document.getElementById(&#8220;contentloadtag&#8221;)<br />
  contentloadtag.onreadystatechange=function(){<br />
    if (bgimg.readyState==&#8221;complete&#8221;){<br />
      alreadyrunflag=1;<br />
      init();<br />
    }<br />
  }<br />
}</p>
<p>window.onload=function(){<br />
  setTimeout(&#8220;if (!alreadyrunflag){init();}&#8221;, 0)<br />
}</p>
<p>any reason ? <img src='http://www.search-this.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>yo!</p>
<p>Roby</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jared</title>
		<link>http://www.search-this.com/2008/06/17/nicely-fitting-background-images/comment-page-1/#comment-81898</link>
		<dc:creator>Jared</dc:creator>
		<pubDate>Wed, 06 Aug 2008 21:06:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.search-this.com/?p=696#comment-81898</guid>
		<description>P.S.  The issue seems to be with the  &quot;onreadystate&quot; declarations on lines 37 and 38.

The error message I receive when trying to view the page in IE is as follows:

Line: 39
Char: 5
Error: &#039;bgimg.readyState&#039; is null or not an object
Code: 0
URL: http://www.search-this.com/wp-content/uploads/2008/06/fsbg.html</description>
		<content:encoded><![CDATA[<p>P.S.  The issue seems to be with the  &#8220;onreadystate&#8221; declarations on lines 37 and 38.</p>
<p>The error message I receive when trying to view the page in IE is as follows:</p>
<p>Line: 39<br />
Char: 5<br />
Error: &#8216;bgimg.readyState&#8217; is null or not an object<br />
Code: 0<br />
URL: <a href="http://www.search-this.com/wp-content/uploads/2008/06/fsbg.html" rel="nofollow">http://www.search-this.com/wp-content/uploads/2008/06/fsbg.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

