<?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>Gaya Design &#187; preloader</title>
	<atom:link href="http://www.gayadesign.com/tag/preloader/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gayadesign.com</link>
	<description>blog focused on everything webdevelopment.</description>
	<lastBuildDate>Sat, 18 May 2013 08:33:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>QueryLoader2 &#8211; Preload your images with ease</title>
		<link>http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=queryloader2-preload-your-images-with-ease</link>
		<comments>http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 20:10:38 +0000</pubDate>
		<dc:creator>Gaya</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[load images]]></category>
		<category><![CDATA[preload]]></category>
		<category><![CDATA[preloader]]></category>
		<category><![CDATA[queryLoader]]></category>
		<category><![CDATA[queryLoader2]]></category>

		<guid isPermaLink="false">http://www.gayadesign.com/?p=678</guid>
		<description><![CDATA[<p>Gaya Design is back in business and hitting hard with a redo of the 2009 script QueryLoader. I kept getting e-mails and comments about it and thought I had left it just hanging there for way too long. It had become very outdated. So here it is: version 2 of QueryLoader! A direct link to [...]</p><p>The post <a href="http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/">QueryLoader2 &#8211; Preload your images with ease</a> appeared first on <a href="http://www.gayadesign.com">Gaya Design</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>Gaya Design is back in business and hitting hard with a redo of the 2009 script QueryLoader. I kept getting e-mails and comments about it and thought I had left it just hanging there for way too long. It had become very outdated. So here it is: version 2 of QueryLoader!</p>
<p><a class="border" href="http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/"><img class="size-full wp-image-684 alignnone" title="QueryLoader2 - Preload your images with ease" alt="QueryLoader2 - Preload your images with ease" src="http://www.gayadesign.com/wp-content/uploads/2011/10/ql2header.jpg" width="580" height="154" /></a></p>
<p><span id="more-678"></span></p>
<p>A direct link to the zipfile:<br />
<a href="https://github.com/Gaya/QueryLoader2/zipball/master">https://github.com/Gaya/QueryLoader2/zipball/master</a></p>
<p>View the example here:<br />
<a href="http://www.gayadesign.com/scripts/queryLoader2/">http://www.gayadesign.com/scripts/queryLoader2/</a></p>
<p>What QueryLoader2 does is simply scanning the given elements for images (and background images) and preloading them before the website is visible.<br />
This version has been modified to make it easier for users to implement (especially those who are already into jQuery.)</p>
<p>QueryLoader currently works with jQuery v1.7.1 and in IE version &gt; 7, Chrome, Safari and Firefox.</p>
<h2>How to use:</h2>
<p>Include the script in the head section of your webpage.</p>
<pre><code class='language-markup'>&lt;script src=&quot;path/to/file/jquery.queryloader2.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</code></pre>
<p>Be sure to add it after you include jQuery.</p>
<p>Now call QueryLoader in a <span class="code">$(document).ready()</span> like this:</p>
<pre><code class='language-javascript'>$(document).ready(function () {
    $(&quot;body&quot;).queryLoader2();
});</code></pre>
<p>To make it work for iOS devices, use this code:</p>
<pre><code class='language-javascript'>window.addEventListener('DOMContentLoaded', function() {
    $(&quot;body&quot;).queryLoader2();
});</code></pre>
<p>That's it! You're done.</p>

        <div class="docs">
            <h4> QueryLoader2</h4>

            
                <div class="function">
                    <div class="synthax">
                        <span class="f"> queryLoader2</span>(                            <span class="t">object</span> <span class="v"> options</span>
                            );
                    </div>

                    <p class="desc">
                        You can add options to loader.                    </p>

                    
                            <table class="options last">
                                <tr class="heading">
                                    <th colspan="2">
                                        options                                    </th>
                                </tr>
                                                                        <tr>
                                            <td class="param">
                                                <span class="t">string</span> <span class="v"> backgroundColor</span>
                                            </td>
                                            <td class="desc">
                                                Background color of the loader (in hex).                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">string</span> <span class="v"> barColor</span>
                                            </td>
                                            <td class="desc">
                                                Background color of the bar (in hex).                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">int</span> <span class="v"> barHeight</span>
                                            </td>
                                            <td class="desc">
                                                Height of the bar in pixels. Default: 1                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">bool</span> <span class="v"> deepSearch</span>
                                            </td>
                                            <td class="desc">
                                                Set to true to find ALL images with the selected elements. If you don't want queryLoader to look in the children, set to false. Default: true.                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">int</span> <span class="v"> barHeight</span>
                                            </td>
                                            <td class="desc">
                                                Height of the bar in pixels. Default: 1                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">bool</span> <span class="v"> percentage</span>
                                            </td>
                                            <td class="desc">
                                                Set to true to enable percentage visualising. Default is false.                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">string</span> <span class="v"> completeAnimation</span>
                                            </td>
                                            <td class="desc">
                                                Set the animation type at the end. Options: "grow" or "fade". Default is "fade".                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">function</span> <span class="v"> onLoadComplete</span>
                                            </td>
                                            <td class="desc">
                                                This function is called once the loading is complete. This is handy when changing the animation at the end.                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td class="param">
                                                <span class="t">function</span> <span class="v"> onComplete</span>
                                            </td>
                                            <td class="desc">
                                                This function is called once the loading and animation are completed.                                            </td>
                                        </tr>
                                                                    </table>
                                            </div>

                        </div>

        
<h2>GitHub</h2>
<p>As you might have noticed <a href="https://github.com/Gaya/QueryLoader2">I put my code on GitHub</a>. This makes it easier for me to manage my code and give you updates if you or me find any bugs.<br />
You can also <a href="https://github.com/Gaya/QueryLoader2/issues">file issues</a> with the script here and fork it to make changes / fix bugs. If you send me pull requests I will take a look as to what you have changed and commit it if it is an addition.</p>
<p>The post <a href="http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/">QueryLoader2 &#8211; Preload your images with ease</a> appeared first on <a href="http://www.gayadesign.com">Gaya Design</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/feed/</wfw:commentRss>
		<slash:comments>333</slash:comments>
		</item>
		<item>
		<title>QueryLoader &#8211; preload your website in style</title>
		<link>http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=queryloader-preload-your-website-in-style</link>
		<comments>http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 11:43:28 +0000</pubDate>
		<dc:creator>Gaya</dc:creator>
				<category><![CDATA[DIY]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[preload]]></category>
		<category><![CDATA[preloader]]></category>
		<category><![CDATA[queryLoader]]></category>

		<guid isPermaLink="false">http://www.gayadesign.com/?p=489</guid>
		<description><![CDATA[<p>There is always a minor problem when it comes to preloading image on a website. Nobody really has a full solution for it. There are a lot of preloaders available, but most of the time they only display the words: &#8220;Loading page&#8221; or have an animated image that spins. Why can&#8217;t there be a nice [...]</p><p>The post <a href="http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/">QueryLoader &#8211; preload your website in style</a> appeared first on <a href="http://www.gayadesign.com">Gaya Design</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>There is always a minor problem when it comes to preloading image on a website. Nobody really has a full solution for it. There are a lot of preloaders available, but most of the time they only display the words: &#8220;Loading page&#8221; or have an animated image that spins. Why can&#8217;t there be a nice loading bar of some kind?<br />
I&#8217;ve gotten a few request on how to make a preloader, or people asking me how to get all the images of a web page and preload them (even the images in CSS).</p>
<p>This preloader has it all. Loading bar, custom animations and getting all images included in the web page.</p>
<div style="background-color: #fcf8bb; text-align: center; margin-bottom: 1.5em; padding: 0.75em;"><a href="http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/"> There is a new version of QueryLoader. Consider this one obselete!</a></div>
<p><a class="border" href="http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/"><img class="size-full wp-image-490 alignnone" title="QueryLoader - preload your website in style" alt="QueryLoader - preload your website in style" src="http://www.gayadesign.com/wp-content/uploads/2009/09/qloader.jpg" width="580" height="173" /></a></p>
<p><span id="more-489"></span></p>
<div style="background-color: #fcf8bb; text-align: center; margin-bottom: 1.5em; padding: 0.75em;"><a href="http://www.gayadesign.com/diy/queryloader2-preload-your-images-with-ease/"> There is a new version of QueryLoader. Consider this one obselete!</a></div>
<p>(a special shout out goes to Sieb of <a href="http://www.siebdesign.nl">Siebdesign</a> for coming up with the animation and the idea of building a preloader)</p>
<p>Download the source code here:<br />
<a href="http://www.gayadesign.com/scripts/queryLoader/queryLoader.zip">http://www.gayadesign.com/scripts/queryLoader/queryLoader.zip</a></p>
<p>View the example here:<br />
<a href="http://www.gayadesign.com/scripts/queryLoader/">http://www.gayadesign.com/scripts/queryLoader/</a></p>
<p>Example with percentage visible:<br />
<a href="http://www.gayadesign.com/scripts/queryLoaderPercentage/">http://www.gayadesign.com/scripts/queryLoaderPercentage/</a> or download: <a href="http://www.gayadesign.com/scripts/queryLoaderPercentage/qL2.zip">http://www.gayadesign.com/scripts/queryLoader2/qL2.zip</a> (thanks to Olivier Dumetz)</p>
<h2>Features:</h2>
<ul>
<li>Preload a whole web page.</li>
<li>Preload a part of the page.</li>
<li>Gets all images, &lt;img&gt; tags and background-image of your CSS</li>
<li>Easy to implement.</li>
<li>Adjustable loading bar.</li>
<li>Tested in Firefox, Safari, Opera, Chrome, IE7, IE8 and IE6 (script will be ignored in IE6 though).</li>
</ul>
<h2>Implementation:</h2>
<p>To implement this script you don&#8217;t need any Javascript experience. Just follow these easy steps:</p>
<p><strong>1.</strong> Download <a href="http://www.gayadesign.com/scripts/queryLoader/queryLoader.zip">the zipped archive</a>.</p>
<p><strong>2.</strong> Upload the contents to your webserver.</p>
<p><strong>3.</strong> Place the following code in thepart of your page:</p>
<pre><code class='language-markup'>&lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js'&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/queryLoader.css&quot; type=&quot;text/css&quot; /&gt;
&lt;script type='text/javascript' src='js/queryLoader.js'&gt;&lt;/script&gt;</code></pre>
<p>Remove the jQuery part if you have already included the file.</p>
<p><strong>4.</strong> Place this code at the bottom of your page:</p>
<pre><code class='language-markup'>&lt;script type='text/javascript'&gt;
QueryLoader.init();
&lt;/script&gt;</code></pre>
<p>You are now done!</p>
<h2>Customization:</h2>
<p>If you only want one element / container to be preloaded you can setup a jQuery selector to only preload what you want.</p>
<p>Let's say you have an element with an id. You only want the images inside that element to be preloaded. You can use the following code:</p>
<pre><code class='language-markup'>&lt;script type='text/javascript'&gt;
QueryLoader.selectorPreload = &quot;#idOfTheElement&quot;;
QueryLoader.init();
&lt;/script&gt;</code></pre>
<p>Be aware that you can only preload a single element. So using a class selector could cause some problems.<br />
To read more about selectors in jQuery you can read <a href="http://docs.jquery.com/Selectors">this page in the jQuery docs</a>.</p>
<p>To adjust the animations of the loading bar, you can take a look in the following functions:<br />
<span class="code">QueryLoader.animateLoader()</span> and <span class="code">QueryLoader.doneLoad()</span></p>
<p>Adjusting these functions requires a bit of jQuery knowledge.</p>
<p>Any questions about QueryLoader and implementations can be posted in the comments below.</p>
<p>Good luck and happy developing.</p>
<p>The post <a href="http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/">QueryLoader &#8211; preload your website in style</a> appeared first on <a href="http://www.gayadesign.com">Gaya Design</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.gayadesign.com/diy/queryloader-preload-your-website-in-style/feed/</wfw:commentRss>
		<slash:comments>686</slash:comments>
		</item>
	</channel>
</rss>
