<?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>Connecting the dots... &#187; ajax</title>
	<atom:link href="http://blog.rajatpandit.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rajatpandit.com</link>
	<description>Thoughts on Web Development, Infrastructure and Application Scalability</description>
	<lastBuildDate>Thu, 29 Dec 2011 13:21:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>CSS only technique for showing a loader for slow loading images</title>
		<link>http://blog.rajatpandit.com/2008/06/11/css-only-technique-for-slow-loading-images/</link>
		<comments>http://blog.rajatpandit.com/2008/06/11/css-only-technique-for-slow-loading-images/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 22:40:35 +0000</pubDate>
		<dc:creator>rp</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[loader]]></category>
		<category><![CDATA[search monkey]]></category>
		<category><![CDATA[slow loading image]]></category>

		<guid isPermaLink="false">http://blog.rajatpandit.com/?p=21</guid>
		<description><![CDATA[Recently I had a requirement to show images inside an overlay, the problem was that the image that had to loaded was coming loading very slowing and the user couldnt...]]></description>
			<content:encoded><![CDATA[<p>Recently I had a requirement to show images inside an overlay, the problem was that the image that had to loaded was coming loading very slowing and the user couldnt get any sort of indication that the image was being loaded.</p>
<p>Ofcourse one clear solution was to call it via HTTPRequestObject but obviously that would have been an overkill for loading just an image, I came up with this solution (and i dont make any claims that no one has ever done this before) to use css only to method to show a loading image <img style="vertical-align: middle;" src="http://l.yimg.com/us.yimg.com/i/br/misc/16_loading.gif" alt="" width="16" height="16" /> which is later <em>replaced</em> once the actual image has downloaded.</p>
<p>NOTE: This technique doesn&#8217;t work for transparent images.</p>
<p>The markup:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;app-mod-mod1&quot; class=&quot;mod&quot;&gt;
&lt;img src=&quot;slow_loading.gif&quot;&gt;
&lt;/div&gt;
</pre>
<p>CSS:</p>
<pre class="brush: css; title: ; notranslate">
#app-mod-mod1 {
background: #FF url('ajaxyloader.gif') no-repeat fixed top left;
}
</pre>
<p>This will cause the image ajaxloader.gif to be loaded as the background for the div and it will get hidden behind the non transparent slow loading image.</p>
<p>A simple solution but works, without having to rely on javascript to updated the css classname and other cross browser incompatibility issues.</p>
<div id="in_post_ad_bottom_1" style="clear:both;margin:0;padding:0;"><div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-bp */
google_ad_slot = "7787511801";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div class="brp-bp-234">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-4254382394977039";
/* brp-234x60-BP-1 */
google_ad_slot = "9111022353";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div></div><div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.rajatpandit.com/2008/06/11/css-only-technique-for-slow-loading-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

