<?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>Random Web Tools &#187; loading</title>
	<atom:link href="http://www.randomtools.net/tag/loading/feed" rel="self" type="application/rss+xml" />
	<link>http://www.randomtools.net</link>
	<description>Advice and tools from a young web developer</description>
	<lastBuildDate>Mon, 16 Aug 2010 06:16:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How To: Create a Simple Visual &#8220;Loading&#8221; Effect</title>
		<link>http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html</link>
		<comments>http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html#comments</comments>
		<pubDate>Fri, 18 Jul 2008 04:24:14 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[buffer]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[loading]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html</guid>
		<description><![CDATA[If you&#39;ve got a script that takes a while to load and want to make your user aware that everything is alright, then this tool is for you. The idea is simple &#8211; display the message before the labor intensive part of the script runs, and then using CSS after the labor intensive part of [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#39;ve got a script that takes a while to load and want to make your user aware that everything is alright, then this tool is for you. The idea is simple &#8211; display the message before the labor intensive part of the script runs, and then using CSS after the labor intensive part of the script, hide the message. If you&#39;re using a language that provides a buffer (ASP for instance), make sure you turn the buffer off first, or this won&#39;t have any effect. (eg. Response.Buffer = False) Example (<a href="http://randomtools.net/scripts/loading.php">See it in action</a>):</p>
<pre class="brush: php">&lt;?php
ini_set(&#39;implicit_flush&#39;, &#39;on&#39;);

echo &#39;&lt;p id=&quot;loading_msg&quot;&gt;&lt;img src=&quot;http://img520.imageshack.us/img520/4950/loadingvp7.gif&quot; alt=&quot;&quot; style=&quot;vertical-align: middle;&quot; /&gt; Loading...&lt;/p&gt;&#39;;

// Code that takes forever here, could of course be any language
sleep(5); // Only for demonstration

echo &#39;&lt;script type=&quot;text/javascript&quot;&gt;
window.onload = init;

function init() {
	document.getElementById(&quot;loading_msg&quot;).style.display = &quot;none&quot;;
}
&lt;/script&gt;&#39;;
echo &#39;&lt;p&gt;Woohoo, five seconds passed.&lt;/p&gt;&#39;;

require_once(&#39;includes/trackers.inc.php&#39;);
?&gt;</pre>
<div class='bookmarkify'><a name='bookmarkify'></a><div class='title' title='Use these links to share this page with others'>Bookmark this page</div><div class='linkbuttons'><a href='http://del.icio.us/post?url=http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html&amp;title=How To: Create a Simple Visual &#8220;Loading&#8221; Effect' title='Save to del.icio.us' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/delicious.png' style='width:16px; height:16px;' alt='[del.icio.us] ' /></a> <a href='http://digg.com/submit?phase=2&amp;url=http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html&amp;title=How To: Create a Simple Visual &#8220;Loading&#8221; Effect' title='Digg It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/digg.png' style='width:16px; height:16px;' alt='[Digg] ' /></a> <a href='http://www.facebook.com/share.php?u=http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html' title='Save to Facebook' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/facebook.png' style='width:16px; height:16px;' alt='[Facebook] ' /></a> <a href='http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html&amp;title=How To: Create a Simple Visual &#8220;Loading&#8221; Effect' title='Save to Google Bookmarks' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/google.png' style='width:16px; height:16px;' alt='[Google] ' /></a> <a href='http://reddit.com/submit?url=http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html&amp;title=How To: Create a Simple Visual &#8220;Loading&#8221; Effect' title='Reddit' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/reddit.png' style='width:16px; height:16px;' alt='[Reddit] ' /></a> <a href='http://slashdot.org/bookmark.pl?url=http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html&amp;title=How To: Create a Simple Visual &#8220;Loading&#8221; Effect' title='Slashdot It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/slashdot.png' style='width:16px; height:16px;' alt='[Slashdot] ' /></a> <a href='http://www.stumbleupon.com/submit?url=http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html&amp;title=How To: Create a Simple Visual &#8220;Loading&#8221; Effect' title='Stumble It!' onclick='target="_blank";' rel='nofollow'><img src='http://www.randomtools.net/wp-content/plugins/bookmarkify/stumbleupon.png' style='width:16px; height:16px;' alt='[StumbleUpon] ' /></a> </div></div>]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-create-a-simple-visual-loading-effect-12.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
