<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Making fancy websites without Flash 2: Animating background image</title>
	<atom:link href="http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/</link>
	<description>Tips &#38; Tricks on Web Design and Development</description>
	<lastBuildDate>Thu, 25 Aug 2011 00:12:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Michael</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-139</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 19 Jul 2011 15:03:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-139</guid>
		<description>Actually, in the jquery.BgImageTransition.js file, I added this:

if (helperElement.css(&#039;display&#039;) == &#039;block&#039;) {
	$(this).css(&#039;background-image&#039;,&#039;url(&#039;+src+&#039;)&#039;);
}

just before the var tempImage = new Image(); statement.

Since the helperElement is the div that the plugin creates and toggles in and out in front of your original element (via z-index), I checked if the helperElement has &quot;display:block&quot; and then if so, changed the background-image to the original div (in my case). Seems to work! Now to test it in IE... =(</description>
		<content:encoded><![CDATA[<p>Actually, in the jquery.BgImageTransition.js file, I added this:</p>
<p>if (helperElement.css(&#8216;display&#8217;) == &#8216;block&#8217;) {<br />
	$(this).css(&#8216;background-image&#8217;,'url(&#8216;+src+&#8217;)');<br />
}</p>
<p>just before the var tempImage = new Image(); statement.</p>
<p>Since the helperElement is the div that the plugin creates and toggles in and out in front of your original element (via z-index), I checked if the helperElement has &#8220;display:block&#8221; and then if so, changed the background-image to the original div (in my case). Seems to work! Now to test it in IE&#8230; =(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-138</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Tue, 19 Jul 2011 14:38:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-138</guid>
		<description>Great help—thanks! Like a few people have mentioned, the optional &quot;step 5&quot; in the case of several photos was never explained, was it? The way the plugin natively works is alternating back to the initial image every time...

There&#039;s got to be a way to change the initial div as well, so that when the HelperElement fades out, the next image is in place (or even if, once the HelperElement faded in, to set the same image as the initial background-image, so that when the HelperElement fades out, it doesn&#039;t revert to the initial image, and you could just speed up the transition or something)...

Any help would be greatly appreciated... Thanks!</description>
		<content:encoded><![CDATA[<p>Great help—thanks! Like a few people have mentioned, the optional &#8220;step 5&#8243; in the case of several photos was never explained, was it? The way the plugin natively works is alternating back to the initial image every time&#8230;</p>
<p>There&#8217;s got to be a way to change the initial div as well, so that when the HelperElement fades out, the next image is in place (or even if, once the HelperElement faded in, to set the same image as the initial background-image, so that when the HelperElement fades out, it doesn&#8217;t revert to the initial image, and you could just speed up the transition or something)&#8230;</p>
<p>Any help would be greatly appreciated&#8230; Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: janimal</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-68</link>
		<dc:creator>janimal</dc:creator>
		<pubDate>Fri, 07 May 2010 09:13:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-68</guid>
		<description>I used a modulo function to send the images sequentially and to wrap around the index, but the issue is the same as Jason has.

The problem appears to be related to your point number 5 in the post.

The script never replaces the image used for the initial div. I will try to fix it myself, but I am brand new to Javascript.

For those struggling with a sequential function try the following.
1) use the array index instead of a string to set the next image
   eg: $(&#039;#banner&#039;).BgImageTransition(&#039;/images/featured/&#039;+bgImages[currIndex]);

2) Set currIndex to 0 before calling setInterval

3) increment currIndex within setInterval like this
   currIndex = ++currIndex % bgImages.length;

This will give you sequential indexes which wraps around to the 1st element when it reaches the upper bound of the array</description>
		<content:encoded><![CDATA[<p>I used a modulo function to send the images sequentially and to wrap around the index, but the issue is the same as Jason has.</p>
<p>The problem appears to be related to your point number 5 in the post.</p>
<p>The script never replaces the image used for the initial div. I will try to fix it myself, but I am brand new to Javascript.</p>
<p>For those struggling with a sequential function try the following.<br />
1) use the array index instead of a string to set the next image<br />
   eg: $(&#8216;#banner&#8217;).BgImageTransition(&#8216;/images/featured/&#8217;+bgImages[currIndex]);</p>
<p>2) Set currIndex to 0 before calling setInterval</p>
<p>3) increment currIndex within setInterval like this<br />
   currIndex = ++currIndex % bgImages.length;</p>
<p>This will give you sequential indexes which wraps around to the 1st element when it reaches the upper bound of the array</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-65</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Fri, 02 Apr 2010 01:40:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-65</guid>
		<description>I&#039;m also trying to run through a list of images, which was easy enough to do, however it alternates to the initial image every other time.

So instead of: Image1.jpg, Image2.jpg, Image3.jpg, Image4.jpg, Image5.jpg.....
I&#039;m getting: Image1.jpg, Image2.jpg, Image1.jpg, Image4.jpg, Image1.jpg, Image6.jpg.....</description>
		<content:encoded><![CDATA[<p>I&#8217;m also trying to run through a list of images, which was easy enough to do, however it alternates to the initial image every other time.</p>
<p>So instead of: Image1.jpg, Image2.jpg, Image3.jpg, Image4.jpg, Image5.jpg&#8230;..<br />
I&#8217;m getting: Image1.jpg, Image2.jpg, Image1.jpg, Image4.jpg, Image1.jpg, Image6.jpg&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-61</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Fri, 11 Dec 2009 14:44:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-61</guid>
		<description>This is very helpful. However, in your demo, Rosso Castilla.JPG never loads?</description>
		<content:encoded><![CDATA[<p>This is very helpful. However, in your demo, Rosso Castilla.JPG never loads?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: georgi</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-60</link>
		<dc:creator>georgi</dc:creator>
		<pubDate>Fri, 28 Aug 2009 06:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-60</guid>
		<description>You should I am no sure whether you can. Just create a new div element the first child of the body and make it &quot;snap&quot; the body borders. Then make it switch images.</description>
		<content:encoded><![CDATA[<p>You should I am no sure whether you can. Just create a new div element the first child of the body and make it &#8220;snap&#8221; the body borders. Then make it switch images.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karthick</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-59</link>
		<dc:creator>Karthick</dc:creator>
		<pubDate>Thu, 27 Aug 2009 22:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-59</guid>
		<description>Hi Georgi,

 Great script! but i have to apply it on body tag instead of div..Could u plz guide? 

Thanks,

karthick</description>
		<content:encoded><![CDATA[<p>Hi Georgi,</p>
<p> Great script! but i have to apply it on body tag instead of div..Could u plz guide? </p>
<p>Thanks,</p>
<p>karthick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: georgi</title>
		<link>http://www.ovalpixels.com/blog/2009/02/21/making-fancy-websites-without-flash-animating-background-image/comment-page-1/#comment-58</link>
		<dc:creator>georgi</dc:creator>
		<pubDate>Fri, 31 Jul 2009 10:03:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.ovalpixels.com/blog/?p=87#comment-58</guid>
		<description>@Tom: I cannot write your js since you know your project much better and your job to do it. Create an array with the images and loop through it instead of using random()</description>
		<content:encoded><![CDATA[<p>@Tom: I cannot write your js since you know your project much better and your job to do it. Create an array with the images and loop through it instead of using random()</p>
]]></content:encoded>
	</item>
</channel>
</rss>

