<?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>allcreatives.net &#187; Guides &amp; Tutorials</title>
	<atom:link href="http://allcreatives.net/category/guides-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://allcreatives.net</link>
	<description></description>
	<lastBuildDate>Sat, 08 May 2010 16:22:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Rediscovering open source ecommerce offerings</title>
		<link>http://allcreatives.net/2010/05/08/rediscovering-open-source-ecommerce-offerings/</link>
		<comments>http://allcreatives.net/2010/05/08/rediscovering-open-source-ecommerce-offerings/#comments</comments>
		<pubDate>Sat, 08 May 2010 16:21:26 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Commentary, Opinions & Thoughts]]></category>
		<category><![CDATA[External Resources & Freebies]]></category>
		<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[opencart]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=432</guid>
		<description><![CDATA[A few weeks ago I started work on a ecommerce project with a budget. As with many projects on a tight budget and indeed some without, the lack of budget was made up with some open source assistance. This takes the sting out of some of the development costs and thankfully for ecommerce products there [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I started work on a ecommerce project with a budget. As with many projects on a tight budget and indeed some without, the lack of budget was made up with some open source assistance. This takes the sting out of some of the development costs and thankfully for ecommerce products there is no shortage of free or inexpensive open source offerings. I&#8217;ve been away from this kind of development for a while so it was nice to go back and rediscover what is on offer out there.</p>
<h2>Magneto</h2>
<p>Magento was my first port of call as it does look head and shoulders above any other free offering and indeed the feature set looks rich enough to compete with many commercial offerings. What I discovered rather quickly and frustratingly was that Magento is horribly complicated to skin and manipulate. The learning curve of Magento is quite possibly the steepest I have ever come across in open source product. I&#8217;d love to get to grips with Magento and really learn the ins and outs but it seems that Magento skinning and tweaking is a skill picked up over the course of months and months rather than days which is really what you need when you are coming into a project that is already on a tight budget.</p>
<p><a href="http://www.magentocommerce.com/" target="_blank">Magneto Commerce</a></p>
<h2>osCommerce / Zen Cart</h2>
<p>osCommerce seems to be going strong after many years of open source development. The issue I always had with osCommerce however is that it feels badly put together and not entirely secure. The organisation of the source files and the admin interface were always pretty shabby. Now in osCommerce&#8217; defence the last time I used a release was many years ago but unless there has been a complete overhaul I can&#8217;t see this being much improved over that version.</p>
<p>Similarly Zen Cart seems to suffer the same fate. The admin interface screams osCommerce and if Zen Cart is simply osCommerce re-labeled (not confirmed but likely) it will more than likely have osCommerce like issues.</p>
<p><a href="http://www.oscommerce.com/" target="_blank">osCommerce</a> | <a href="http://www.zen-cart.com/" target="_blank">Zen Cart</a></p>
<h2>Cubecart / X-Cart and similar</h2>
<p>Cubecart, X-Cart and similar sit on on a level above the free offerings but below the full blown commercial offerings. They are solid products but are still commercial offerings which deduct, however minor, from a project&#8217;s budget. Had I not found the next open source product in this list I would have probably stumped for one of these or one of there many derivatives which are all fairly similar in features and set-up. Again solid offerings but not within the open source range. </p>
<p><a href="http://www.cubecart.com/" target="_blank">CubeCart</a> | <a href="http://www.x-cart.com/" target="_blank">X-Cart</a></p>
<h2>OpenCart</h2>
<p>My saviour. Quite frankly not a great deal seems to have changed with regards to open source ecommerce products since the break through of Magento apart from this neat piece of development.</p>
<p>The structure of OpenCart follows MVC, Model View Controller and in general the code is nicely put together and feels clean as well as secure. Following the MVC convention makes OpenCart as flexible and as complex as you need or want it to be. The admin interface is clean and rather aesthetically pleasing whilst being packed with features.</p>
<p>The only grumble I have over OpenCart is that it&#8217;s realtively young and as such the community and documentation is not quite on par with say, Magento or osCommerce. As the product matures however I am sure that this will only improve.</p>
<p>The most impressive feature of OpenCart is without doubt the lack of bloat. Possibly a positive knock on affect of its young age, the simplicity of the code and the way it is structured in comparison with the punch it packs is quite glorious.</p>
<p><a href="http://www.opencart.com/" target="_blank">OpenCart</a></p>
<h2>In Summary</h2>
<p>As I&#8217;ve mentioned above major players in the open source community don&#8217;t come and go overnight particularly not in a category as crucial as ecommerce development. So it wasn&#8217;t particularly surprising to find that there was not a great number of new stable ecommerce offerings to choose from. </p>
<p>Magento I feel is a definite market leader and something that every self respecting developer should take the time to understand if they are working regularly with ecommerce projects that require open source assistance. OpenCart for my money however can not be beaten for feature set versus learning curve. OpenCart apart from the usual road bumps in using a new open source package has been delightful and will be a project I keep an eye on for any future ecommerce projects.</p>
<p>If I&#8217;ve missed any great open source eccomerce offerings, please do let me know in the comments or via the contact page.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2010/05/08/rediscovering-open-source-ecommerce-offerings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 tried and tested ad. networks to drive revenue to your design or development site.</title>
		<link>http://allcreatives.net/2010/01/21/10-tried-and-tested-ad-networks-to-drive-revenue-to-your-design-or-development-site/</link>
		<comments>http://allcreatives.net/2010/01/21/10-tried-and-tested-ad-networks-to-drive-revenue-to-your-design-or-development-site/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 20:40:16 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Ad Network]]></category>
		<category><![CDATA[Advertisements]]></category>
		<category><![CDATA[Monetize]]></category>
		<category><![CDATA[Pay Per Post]]></category>
		<category><![CDATA[Revenue]]></category>
		<category><![CDATA[Twitter Sponsors]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=312</guid>
		<description><![CDATA[Trying to monetize your hard crafted design or development blog or site is no mean feat. but why shouldn&#8217;t you be rewarded for the hours you spend crafting unique content for your visitors.
Over the years I&#8217;ve been &#8216;at the helm&#8217; of a fair few web sites, some good, some bad but most returning revenue in [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to monetize your hard crafted design or development blog or site is no mean feat. but why shouldn&#8217;t you be rewarded for the hours you spend crafting unique content for your visitors.</p>
<p>Over the years I&#8217;ve been &#8216;at the helm&#8217; of a fair few web sites, some good, some bad but most returning revenue in some form.</p>
<p>I&#8217;m genuinely un-fussed as a visitor if I arrive at a site with tasteful advertisements tucked away in the sidebar. Even sites that are completely loaded with advertisements that have great content don&#8217;t particularly bother me.</p>
<p>Obviously I would consider myself a little more clued-up than an average visitor but then this post is directed at design or development blog owners looking to monetize their content.</p>
<p>How, when, where and why you should display advertisements on your design or development blog are decisions entirely down to you. My opinion on the subject is simple, if done tastefully and with the right motives your audience will respect the decision to monetize the content you&#8217;ve worked hard to bring them.</p>
<p>Below I&#8217;ve produced a write-up of each advertisement network or revenue source I&#8217;ve come across that are applicable to design or development resource and blog sites. With each write-up I&#8217;ll give you my experience with the network, what type of advertisements they offer, likeliness of being accepted and payout information that may help you get a better return from the network or revenue source.</p>
<p><em><small><strong>Note:</strong> A few, if not, all of the links outgoing to networks and revenue sources from this post will be referal links. To those who are unaware, these links mean that if you go on start earning with the sites I&#8217;ve recommended I&#8217;ll receive a nice bonus from them myself for refering you. If you think this is unreasonable and I&#8217;m a greedy so and so then I&#8217;m sure you can find a way to the sites directly.</small></em></p>
<hr />
<p><a href="http://bit.ly/8p1pSN" target="_blank">Sponsored Tweets</a><br />
Type of ads : Tweets<br />
<img class="alignleft size-full wp-image-342 bordered" style="float:right;" title="sponsoredtweets" src="http://allcreatives.net/wp-content/uploads/2010/01/sponsoredtweets.png" alt="sponsoredtweets" width="110" />An extremely interesting network especially for the designers and developers of the web. This network does exactly what it says on the tin. It allows to you sell sponsored tweets to advertisers. Heck! you don&#8217;t even need to have a web site to use Sponsored Tweets. They have a lot of celebrities on their books at present and the more followers you have on twitter, the better payouts you are likely to receive. The price per tweet is extremely good for this network. You will need to have 100 tweets, 100 followers and have an account over 60 days old to be publicized in the advertiser directory but you can still sign up if you don&#8217;t meet these requirements for possible direct offers. <strong>Highly recommended.</strong></p>
<hr />
<p><a href="http://www.amazon.co.uk/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.co.uk%2F&amp;tag=pinaisla-21&amp;linkCode=ur2&amp;camp=1634&amp;creative=19450" target="_blank">Amazon.co.uk</a> &amp; <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2F&amp;tag=pinaisla-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=390957" target="_blank">Amazon.com</a><br />
Type of ads : Commission based referrals<br />
<img class="alignleft size-full wp-image-354 bordered" style="float:right;" title="amazon" src="http://allcreatives.net/wp-content/uploads/2010/01/amazon.png" alt="amazon" width="110" />An ol&#8217; cornerstone of the web, Amazon.com and the co.uk variant allow you to sign up to their associates program and promote products they have in stock for a percentage of any sale that is made from said promotion. Its quick and easy to get started with them and the acceptance criteria is very low. Where Amazon come in pretty handy for design and development web sites is their great range of books related to the subject of design and development. The referral fee per product varies slightly but it usually sits between 5 and 10% of the sold product value.</p>
<hr />
<p><a href="http://peerfly.com/?r=4623" target="_blank">Peerfly.com</a><br />
Type of ads : CPA<br />
<img class="alignleft size-full wp-image-358 bordered" style="float:right;" title="peerfly" src="http://allcreatives.net/wp-content/uploads/2010/01/peerfly.png" alt="peerfly" width="110" />A personal favourite of mine &#8211; Peerfly are starting to gain a big reputation amongst web site owners. Their payment model maybe a little different from what most design and development blog and site owners are used too. With that said the potential rewards for your visitors and indeed yourself as the site owner are good. Peerfly are a Cost Per Action network which means that their advertisers will pay you when one of your visitors fulfill a predefined action on their web site. This can be a simple as one of your visitors entering their email address for a macbook competition (which is an offer available right now). Payouts vary depending on the types of offer but if your looking for a different type of ad network than the crowd Peerfly are very much recommended.</p>
<hr />
<p><a href="http://www.google.com/adsense" target="_blank">Google Adsense</a><br />
Type of ads : CPC (mainly)<br />
<img class="alignleft size-full wp-image-333 bordered" style="float:right;" title="adsense" src="http://allcreatives.net/wp-content/uploads/2010/01/adsense.png" alt="adsense" width="110" height="39" />Google Adsense are second to none the in the advertisement network stakes. The acceptance criteria is also one that 99% of web sites should fulfill with ease. They offer a range of advertising types to help monetize your design or development sites but by far their most popular are the Cost Per Click adverts. Google Adsense have also recently added mobile phone specific advertisements and advertisements for feeds, which are perfect for design or development web sites with a big readership. Your earning power with Google Adsense will vary from page to page as it is completely dependant on which keywords Google find in each of your pages. All in all with the low acceptance barrier and not forgetting the highly customizable adverts Adsense is a good choice for any web design or development site. Google Adsense offer a variety of payment options.</p>
<hr />
<p><script type="text/javascript">// <![CDATA[
/* [CDATA[ */
function affiliateLink(str){ str = unescape(str); var r = ''; for(var i = 0; i < str.length; i++) r += String.fromCharCode(6^str.charCodeAt(i)); document.write(r); } affiliateLink('%3Ag%26ntc%60%3B%24nrrv%3C%29%29qqq%28rc%7Er+johm+gbu%28eik%299tc%60%3B3631%3E%248Rc%7Er%26Johm%26Gbu%3A%29g8'); /*  */
// ]]&gt;</script><br />
Type of ads : Text Links<br />
<img class="alignleft size-full wp-image-334 bordered" style="float:right;" title="tla" src="http://allcreatives.net/wp-content/uploads/2010/01/tla.png" alt="tla" width="110" />Text Link Ads are a great network I&#8217;ve used on a number of occasions. They allow you to drop a block of Javascript code into your pages and then they will broker for you in getting advertisers to purchase text links on these pages. The higher pagerank your web site has the better the going rate will be for your text link real estate. Page rank really is the key with this network to getting the best price for your advertisements. A nice bonus is the extremely usable interface that Text Link Ads provide for publishers, that not only allows you to switch between Advertiser or Publisher but also allows you to manage multiple web sites from one account. Payment options are cheque or paypal.</p>
<hr />
<p><script type="text/javascript">// <![CDATA[
/* <![CDATA[ */
function affiliateLink(str){ str = unescape(str); var r = ''; for(var i = 0; i < str.length; i++) r += String.fromCharCode(10^str.charCodeAt(i)); document.write(r); } affiliateLink('6k*bxol7%28b%7E%7Ez0%25%25%7D%7D%7D%24cdfcday%24ieg%255xol782%3F%3C%3D%3B%284cdFcday6%25k4'); /* ]] */ // --&gt;
// ]]&gt;</script><br />
Type of ads : Inline Text Links<br />
<img class="alignleft size-full wp-image-369 bordered" style="float:right;" title="inlinks" src="http://allcreatives.net/wp-content/uploads/2010/01/inlinks.png" alt="inlinks" width="110" />A different type of advertisement offered to any of the other networks featured in this post. inLinks allow you to sell individual words and sentences in your posts to advertisers. They allow a high level of customization and control over what you sell and what it looks like so the advertisements are less likely to make a pig&#8217;s ear of your valuable content. Used correctly inLinks can be a constant yet subtle source of income for your design or development blog. Payment is via Paypal or Cheque.</p>
<hr />
<p><a href="http://www.buysellads.com" target="_blank">Buysellads.com</a><br />
Type of ads : CPM<br />
<img class="alignleft size-full wp-image-339 bordered" style="float:right;" title="buysellads" src="http://allcreatives.net/wp-content/uploads/2010/01/buysellads.png" alt="buysellads" width="110" />Buysellads.com are relatively new in comparison with some of the other networks listed here. They are responsible for some, if not most of the side image advertisements across design and development web sites. At the time of writing I&#8217;d take a punt and say they were the leaders in design and development blog and web site advertising. They have a very high standard of sites under their control and you may find it hard to become an accepted publisher if you are new or have low traffic numbers. Using their administration area you can designate specific ad areas that you would like to offer potential advertisers. Buysellads.com then act as a broker for setting up the relationship between yourself and the advertiser. They do take a slightly larger cut of your agreed price with any advertiser but are fast becoming the most reputable design and development advertising network.</p>
<hr />
<p><a href="http://www.adbrite.com/mb/landing_both.php?spid=131531&amp;afb=120x60-1-blue" target="_blank">Adbrite.com</a><br />
Type of ads : CPC, CPM<br />
<img class="alignleft size-full wp-image-365 bordered" style="float:right;" title="adbrite" src="http://allcreatives.net/wp-content/uploads/2010/01/adbrite.png" alt="adbrite" width="110" />Adbrite are a Buysellads.com alternative that do a very good job of selling advertisements for their members. Again the return for your site will be dependant on the size but if you need a network similar to Buysellads.com that doesn&#8217;t have as higher acceptance barrier then Adbrite will serve you well. Adbrite also have a wider range of advertising options such as Pay Per Click as opposed to the set time periods of Buysellads.com.</p>
<hr />
<p><a href="http://www.adtoll.com/?ref=21408" target="_blank">AdToll</a><br />
Type of ads : CPC, CPM and more<br />
<img class="bordered alignleft size-full wp-image-362" style="float:right;" title="adtoll" src="http://allcreatives.net/wp-content/uploads/2010/01/adtoll.png" alt="adtoll" width="110" />Adtoll are seen as a viable alternative to Buysellads.com and there high acceptance standard. They are also similar to Adbrite. Site owners signing up to Adtoll can expect to be accepted 99% of the time but may find it harder to sell space on there site that they would on Buysellads.com. Payout rates will again depend on the size and popularity of your site. Adtoll offer a range of options for you as a site owner so head over now and take a look.</p>
<hr />
<p><a href="http://www.payperpost.com" target="_blank">Pay Per Post</a><br />
Type of ads : Pay Per Post<br />
<img class="alignleft size-full wp-image-351 bordered" style="float:right;" title="payperpost" src="http://allcreatives.net/wp-content/uploads/2010/01/payperpost.png" alt="payperpost" width="110" />This is one more for the bloggers. Pay Per Post should be pretty self explanatory, you sign up and get paid to make postings on your blog that either review or link to a company or product. The payouts really do differ based on a number of factors such as pagerank and readership. Payments are made via Pay Pal and quite honestly I&#8217;ve had mixed experiences with Pay Per Post but would definitely recommend you give it a try.</p>
<hr />
<p>If you have any experiences with the above networks or would like to suggest one of your own that would be useful to design or development web site owners please leave them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2010/01/21/10-tried-and-tested-ad-networks-to-drive-revenue-to-your-design-or-development-site/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Smoother @font-face embedding in IE 7 &amp; 8</title>
		<link>http://allcreatives.net/2009/12/05/smoother-font-face-embedding-in-ie-7-8/</link>
		<comments>http://allcreatives.net/2009/12/05/smoother-font-face-embedding-in-ie-7-8/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 12:41:54 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[EOT]]></category>
		<category><![CDATA[Font Embedding]]></category>
		<category><![CDATA[Font Squirrel]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Web Fonts]]></category>
		<category><![CDATA[WOFF]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=261</guid>
		<description><![CDATA[You could say I&#8217;ve become somewhat obsessed with @font-face embedding over the past few months. I&#8217;ve most certainly fell head over heels for the @font-face generator from fontsquirrel.com (see the recap below).
One thing however that has always bothered me is IE7 and IE8&#8217;s rendering of embedded fonts, so today with IE tester at hand and [...]]]></description>
			<content:encoded><![CDATA[<p>You could say I&#8217;ve become somewhat obsessed with <a href="http://allcreatives.net/tag/font-face/">@font-face embedding</a> over the past few months. I&#8217;ve most certainly fell head over heels for the @font-face generator from fontsquirrel.com (see the recap below).</p>
<p>One thing however that has always bothered me is IE7 and IE8&#8217;s rendering of embedded fonts, so today with IE tester at hand and google ready to get wild I vowed to come up with a solution and I think I may just have.</p>
<h2>First off a quick recap</h2>
<p>If you haven&#8217;t already read my previous postings on @font-face I&#8217;d like to direct you to the following two posts:</p>
<ul>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/2009/11/09/revisiting-font-face-things-may-be-looking-up/">Revisiting @font-face</a> introduces font embedding options right now.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/">Embedding fonts using @font-face</a> is a guide to using f<a href="http://fontsquirrel.com" target="_blank">ontsquirrel.com&#8217;s</a> previously mention <a href="http://www.fontsquirrel.com/fontface/generator" target="_blank">@font-face generator</a></li>
</ul>
<h2>Now let me illustrate the problem.</h2>
<p><a href="http://allcreatives.net/wp-content/uploads/2009/12/screengrab.png"><img class="bordered alignleft size-full wp-image-268" title="screengrab" src="http://allcreatives.net/wp-content/uploads/2009/12/screengrab2.png" alt="screengrab" /></a></p>
<p>When embedding using @font-face IE6 (surprisingly) renders the type face perfectly as does Firefox  and Safari but IE7 and IE8 serve up a sub-standard jagged font face that is really not pretty to look at.</p>
<p>Take a look at the <a href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo.html">first demo page</a> for a simple example of a custom font-face that has been embedded. If you can, take a look at this page in both Firefox and either IE7 or 8 to see the difference.</p>
<h2>What causes this?</h2>
<p>After much research I discovered the problem was being caused by Microsoft&#8217;s ClearType functionality. ClearType is designed and very much works to make rendered text online and throughout the windows system clearer to read. That&#8217;s great for body text and like I say it does work but when it comes to custom fonts that have been embedded ClearType is attempting to do a job which isn&#8217;t needed. This is what gives us the sharp, jagged looking font face that we don&#8217;t want. Because we want nicely anti-aliased text like we see in Firefox, IE6 and Safari.</p>
<p><del datetime="2008-08-08T14:03:44+00:00">As a side note I&#8217;m assuming that IE6 never had the functionality to render ClearType functionality and uses some other sort of properietary technology, leading to nicely embedded fonts in IE6 in a perverse sort of way.</del></p>
<p><strong>Update:</strong> For IE6, Windows XP does not force ClearType on in the browser and Windows Vista was shipped with IE7 pre-installed (falling into the bracket of our fix) therefore the risk of IE6 users being exposed to ClearType issues is minimal.</p>
<h2>How to fix this</h2>
<p>The good news is that there is a way to disable ClearType via the browser when visitors are viewing your web site. Now I&#8217;m not recommending this for any other use than what I&#8217;m demonstrating today, in general ClearType gets it right and helps visitors read your site the way it was meant to be read. Disabling ClearType in most circumstances leads to horribly rendered body text and a whole help of problems for your visitors eyes.</p>
<p><strong>The process of disabling ClearType</strong></p>
<p>Internet Explorer as a rule do not apply ClearType to elements using their proprietary CSS filters as they can conflict and result in wider issues for the browser so we can exploit this to make Internet Explorer leave our embedded fonts alone. Now unfortunately there a few subtle differences between the browser that mean we can&#8217;t simply apply a useless filter and move on.</p>
<p>Take a look at the <a href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo2.html">second demo page</a> where I&#8217;ve added a few additional fixes for IE7 and 8. Go ahead and take a look in both Firefox and IE7/8, you should now find a much nicer rendering of the font in IE. I&#8217;ll break down what&#8217;s been added below.</p>
<p><strong>The crux of the fix:</strong></p>
<pre class="brush: css;">
h2, p {font: 36px/44px 'OldSansBlackRegular', Arial, sans-serif;letter-spacing: 0;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=hIEfix.png,sizingMethod=crop);zoom:1;}
</pre>
<p>The above snippet of CSS fixes our smoothing issues in both IE7 and IE8 as seen in the <a href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo2.html">previously linked demo page</a>. The key to this is filter CSS property and the zoom property which are only applicable to Internet Explorer.</p>
<p><strong>Looking at the filter property</strong></p>
<pre class="brush: css;">
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/headers/hIEfix.png,sizingMethod=crop);
</pre>
<p>This part is mostly for IE8, both IE7 and 8 need to have a filter present to disable ClearType but IE8 has to have this filter actual doing something to recognise it. I also noticed when testing that without a background image being present in IE8 the ClearType disable had little effect. So what this filter property does in effect is kill two birds with one stone. We add a filter which checks the required boxes for IE7 and 8 as well as adding a one by one transparent png image to satisfy IE8.</p>
<p><strong>Looking at the zoom property</strong></p>
<pre class="brush: css;">
zoom:1;
</pre>
<p>This is solely for IE7. It fixes an issue with hasLayout. If you don&#8217;t know anything about hasLayout then not to worry. Essentially IE filters can&#8217;t be assigned to any element that doesn&#8217;t have &#8216;layout&#8217; so the zoom:1 property gives our headers &#8216;layout&#8217;. hasLayout is only applicable to IE version 7 and lower as it was dropped from IE8 (thankfully). To learn more about hasLayout see <a href="http://haslayout.net/" target="_blank">here</a>.</p>
<h2>Done and dusted</h2>
<p>So in future when embedding fonts using @font-face you can use two simple IE only CSS properties and a 1 by 1 transparent png to give your fonts that anti-alias effect in IE7/8. You can even place these two properties in a separate IE only stylesheet as we are doing nothing else apart from tweaking the styles.</p>
<p>Just to note that as with any workaround you&#8217;ll need to test this on a site by site basis to ensure the fix is giving you the results you want. Even with this tweak font rendering in IE can still be unpredictable so testing and constant tweaking is a must!</p>
<h2>File Summary</h2>
<ul>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo.html">First Demo Page</a> &#8211; Showing an untouched @font-face embedding example.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo2.html">Second Demo Page</a> &#8211; Showing a @font-face embedding example including the CSS fix.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo.zip" target="_blank">ZIP package</a> &#8211; Containing both example pages and source files.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/2009/12/05/jquery-plugin-ie-font-face-cleartype-fix/">jQuery plugin</a> &#8211; Quick and easy jQuery plugin to achieve this fix.</li>
</ul>
<p>Your viewing this article on <a href="http://allcreatives.net">allcreatives.net</a> &#8211; <a href="http://allcreatives.net">the web design focused blog</a>.</p>
<p><strong>Update :</strong> Follow up post on <a href="http://allcreatives.net/2009/12/19/looking-at-the-bigger-picture-of-cleartype-and-font-face-embedding-firefox-and-safari/">ClearType issues in Firefox and Safari</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/12/05/smoother-font-face-embedding-in-ie-7-8/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Using jQuery to fix IE6 CSS annoyances</title>
		<link>http://allcreatives.net/2009/12/03/using-jquery-to-fix-ie6-css-annoyances/</link>
		<comments>http://allcreatives.net/2009/12/03/using-jquery-to-fix-ie6-css-annoyances/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 20:37:54 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=234</guid>
		<description><![CDATA[With the usage of IE6 finally declining the majority of us can now afford to be a bit more forgiving in our cross browser testing. Despite this in some circumstances the percentage of a site&#8217;s IE6 users is still far to high to do anything other than link a separate stylesheet and spend hours writing [...]]]></description>
			<content:encoded><![CDATA[<p>With the usage of IE6 finally declining the majority of us can now afford to be a bit more forgiving in our cross browser testing. Despite this in some circumstances the percentage of a site&#8217;s IE6 users is still far to high to do anything other than link a separate stylesheet and spend hours writing fixes. The following technique is aimed at those of us that have the luxury of dealing with a smaller audience of IE6 users. As a rule of thumb I aim to use technique when said IE6 audience is smaller than 10%.</p>
<p>So with that said what I am going to demonstrate here is a Javascript based work around for IE6 selector issues using jQuery&#8217;s powerful selector options.</p>
<p>First of all I should mention that a &#8216;do all&#8217; script does already exist, authored by Dean Edwards the IE7 script includes a range of Javascript functions aiming to improve the experience of IE6 visitors viewing your site. The reason I tend to write a custom piece of Javascript rather than use Dean Edward&#8217;s script is simply down to control, I like to be in complete control rather than at the mercy of a third party script and the potential bugs that come along with third party scripts. I also find that the IE7 script contains I little bit more than I need and therefore adds excess weight to my pages.</p>
<h2>The Setup</h2>
<p>What you&#8217;ll need to implement this technique are three files, two you may have already if your site is already established. Firstly a copy of the jQuery framework, a IE6 specific stylesheet and an IE6 specific Javascript file. Of course the IE6 stylesheet and Javascript file will only be executed if the visitor&#8217;s browser is IE6. We achieve this using Microsoft lifesaving conditional browser comments.</p>
<p><strong>An example of how this would look in your page head</strong></p>
<pre class="brush: xml;">
&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/js/jquery.js&quot;&gt;&lt;/script&gt;
&lt;!--[if IE 6]&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/js/ie6.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/path/to/js/ie6.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p>Now what you&#8217;ll need is the <a href="http://docs.jquery.com/Selectors" target="_blank">selectors page of the jQuery documentation open and ready</a>. It is almost identical to select an element in jQuery as it is in CSS but always check the documentation when in doubt.</p>
<p>Also take a look at some of the more <a href="http://www.quirksmode.org/css/contents.html" target="_blank">advanced and 2.1 specification CSS selectors</a> that are compatible with IE7. You&#8217;ll now able to use these and simply work around them in your ie6 Javascript/CSS technique.</p>
<h2>In Practice</h2>
<p><strong>An nice piece of CSS that needs fixing in IE6</strong></p>
<pre class="brush: css;">
p:first-child { font-weight:bold; }
p &gt; img { border:1px solid #CCC;float:right; }
</pre>
<p>So the above CSS will work in IE7, Firefox and any other browser you may care to mention. It uses the first-child selector as well as the parent &gt; child selector. The problem is it doesn&#8217;t work at all in IE6, this is where the technique comes into play.</p>
<p>To work around this in IE6 you can use jQuery to select the CSS elements for IE6 that the stylesheet can&#8217;t.</p>
<p>As I mentioned early on the method of selecting an element in jQuery is almost identical to that of CSS so lets have a look at selecting the elements from the CSS snippet above. Once the elements have been selected they will need to be styled but doing this via Javascript is fairly messy so this script simply adds a new class that can be styled via the IE6 stylesheet on one line.</p>
<p><strong>The IE6 Javascript file</strong></p>
<pre class="brush: jscript;">
$(document).ready( function(){

$(&quot;p:first-child&quot;).addClass(&quot;paragraphfirst&quot;);
$(&quot;p &gt; img&quot;).addClass(&quot;imginp&quot;);

});
</pre>
<p>The Javascript above calls the jQuery document ready function to start.  After this the jQuery selectors get the elements from the CSS code snippet further above and adds a new class to each instance.</p>
<p>So now in IE6 the first instance of a paragraph is accessible as well as any images contained directly in a paragraph using the class names assigned.</p>
<p>The beauty of this is that this file is only loaded in IE6 so does not affect the performance of your site for anyone wise enough to be using a browser other than IE6. As mentioned it also allows easy styling of these elements using one line of CSS code.</p>
<p>Once the classes have been added they are styled via the IE6 only stylesheet.</p>
<p><strong>The IE6 stylesheet corresponding to the Javascript above</strong></p>
<pre class="brush: css;">
.paragraphfirst { font-weight:bold; }
.imginp { border:1px solid #CCC;float:right; }
</pre>
<h2>Usage</h2>
<p>Hopefully given this very simple demonstration of a very powerful technique you can see the benefits of using this technique over struggling with just an IE6 stylesheet on its own. As well as saving you time in IE6 hell it also sets you free to write cleaner, more forward thinking CSS in your regular stylesheets.</p>
<p>You can even get a little more advanced and use jQuery wraps and appends to fix more tricky bugs and add more dividers where necessary.</p>
<p>The key as mentioned earlier is to keep <a href="http://docs.jquery.com/Selectors" target="_blank">the selector page of the jQuery documents</a> a click away and also do some <a href="http://www.quirksmode.org/css/contents.html" target="_blank">research into CSS 2.1 selectors and beyond</a> if you are not already familiar with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/12/03/using-jquery-to-fix-ie6-css-annoyances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>@font-face a guide to embedding gorgeous fonts that work cross-browser</title>
		<link>http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/</link>
		<comments>http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 01:25:00 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[External Resources & Freebies]]></category>
		<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[EOT]]></category>
		<category><![CDATA[Font Embedding]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Web Fonts]]></category>
		<category><![CDATA[WOFF]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=183</guid>
		<description><![CDATA[Since launching the site I've had a few emails regarding the font being used on allcreatives and also the technique used to embed the font. Despite two previous posts on the progress on @font-face I realised I hadn't actually posted up on how to implement @font-face effectively, so here it is.]]></description>
			<content:encoded><![CDATA[<p>Since launching the site I&#8217;ve had a few emails regarding the font being used on allcreatives and also the technique used to embed the font. Despite <a href="http://allcreatives.net/category/fonts/">two previous posts</a> on the progress on @font-face I realised I hadn&#8217;t actually posted up on how to implement @font-face effectively, so here it is.</p>
<p>The process, thanks to <a href="fontsquirrel's @font-face generator" target="_blank">fontsquirrel&#8217;s @font-face generator</a> is now quite straight forward. If you are unsure of what @font-face actually is and what all the fuss is about then hop over the<a href="http://allcreatives.net/category/fonts/"> fonts category</a> and take a look at my last two recent posts on the subject. Using the aforementioned generator we should be able to achieve @font-face perfection is two simple steps.</p>
<h2>Step 1 : Get your @font-face kit</h2>
<p>Font Squirrel have a great resource for prepackaged @font-face kits which are <a href="http://www.fontsquirrel.com/fontface" target="_blank">available here</a> otherwise you can take a font you have already on your system and run it through the <a href="http://www.fontsquirrel.com/fontface/generator">@font-face generator</a>.  Just to note that you will have to check the license agreement for any font you use with this generator to make sure you are legally allowed to embed it.</p>
<p>Now following the steps on the generator page you should now be presented with download package. Take this, download, unzip and then re-upload the font files contained to your web hosting under a sub-directory such as fonts. Do this in the same way you would with a stylesheet. The files you have uploaded should be as follows for each font family you have ran through the generator:</p>
<ul>
<li>yourfont.eot &#8211; for Internet Explorer</li>
<li>yourfont.woff &#8211; for Firefox 3.6+</li>
<li>yourfont.svg &#8211; for Chrome and Opera</li>
<li>yourfont.originalformat &#8211; whether it be .ttf of .otf for Safari and Firefox 3.5</li>
</ul>
<h2>Step 2 : Add the relevant CSS code to your stylesheet</h2>
<p>Now we have our relevant font files uploaded all that&#8217;s left is todo is add the CSS code to our stylesheet the font(s) to be embedded and used. Within the package from Font Squirrel you should have an example CSS file that looks something like this :</p>
<pre class="brush: css;">
/* * This CSS file has been generated by fontsquirrel.com and is based on the work of Paul Irish. * */ /* * * The fonts included are copyrighted by the vendor listed below. * * @vendor: West Wind Fonts * @licenseurl: http://www.fontsquirrel.com/license/Dearest * * */ @font-face { font-family: 'Dearest Regular'; src: url('Dearest.eot'); src: local('Dearest Regular'), local('Dearest'), url('Dearest.woff') format('woff'), url('Dearest.ttf') format('truetype'), url('Dearest.svg#Dearest') format('svg'); } @font-face { font-family: 'Dearest Open Regular'; src: url('Dearest_open.eot'); src: local('Dearest Open Regular'), local('DearestOpen'), url('Dearest_open.woff') format('woff'), url('Dearest_open.ttf') format('truetype'), url('Dearest_open.svg#DearestOpen') format('svg'); } @font-face { font-family: 'Dearest Outline Regular'; src: url('Dearest_outline.eot'); src: local('Dearest Outline Regular'), local('DearestOutline'), url('Dearest_outline.woff') format('woff'), url('Dearest_outline.ttf') format('truetype'), url('Dearest_outline.svg#DearestOutline') format('svg'); }
</pre>
<p>Copy this in its entirety and paste it into your stylesheet. Now look for the parts of the above code that precede an extension such as dearest.svg and change this to the correct path for your font files (uploaded earlier), keeping the font name and extension in place. Obviously the dearest font name in the above code with be replaced by your font file name.</p>
<p>After you have successfully changed the paths to point to the correct location of your font files you can use use the font name in the css &#8216;font-family&#8217; property as you would with Arial or Verdana. Remember that if your font name has spaces in it you&#8217;ll need to enclose the name on the font-family line in single quotes.</p>
<p>Now if you go ahead and check your page in Firefox, Safari or heck even Internet Explorer you should now find beautifully replaced fonts.</p>
<p>Just a final note however to say that whilst @font-face rendering on Mac computers is near perfect it may be a little sketchy on Windows machines, a lot of this has to do with the quality of the font be used. Some fonts just seem to cope better with embedding than others at the moment and whilst Macs seem to mask this better you may find that it is indeed the font itself at fault as opposed to the operating system.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Combining Javascript setInterval and jQuery for lovely looping animations</title>
		<link>http://allcreatives.net/2009/11/10/combining-javascript-setinterval-and-jquery-for-lovely-looping-animations/</link>
		<comments>http://allcreatives.net/2009/11/10/combining-javascript-setinterval-and-jquery-for-lovely-looping-animations/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 22:08:41 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HMTL]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=117</guid>
		<description><![CDATA[Any designer worth his salt will be familiar with jQuery in one form or another.  The uber cool Javascript framework has become a staple of many a design studio worldwide and why not? Quite frankly Javascript frameworks don't come much better or more importantly easier to learn than jQuery. What follows in this writeup however is a practical example of a native Javascript function that designers using jQuery or otherwise may never heard of let alone used ...]]></description>
			<content:encoded><![CDATA[<p>Any designer worth his salt will be familiar with <a href="http://www.jquery.com">jQuery</a> in one form or another.  The uber cool Javascript framework has become a staple of many a design studio worldwide and why not? Quite frankly Javascript frameworks don&#8217;t come much better or more importantly easier to learn than jQuery. What follows in this writeup however is a practical example of a native Javascript function that designers using jQuery or otherwise may never heard of let alone used.</p>
<p>This function goes by the name of setInterval. The reason why you, me or any other designer may never heard of setInterval is quite simple. When using a framework such as jQuery its  a great deal easier to just use it for what you need it for or use plug-ins and never really get into the nitty-gritty of&#8217; &#8216;old school Javascript&#8217;. The majority of the time anything not contained within the jQuery docs. will be not be of particular interest to the majority of designers. Said designers, many times myself included, are under demand from clients to get whatever needs doing completed as quickly as possible and simply do just that.</p>
<h2>A quick introduction to setInterval</h2>
<p>setInterval is a Javascript function that waits for a set amount of milliseconds, executes a function and then repeats again based on the original millisecond time parameter. clearInterval is the antidote to this if you like and stops the original setInterval function when you require.</p>
<p>A similar set of Javascript functions are setTimeout and clearTimeout which differ slightly in there execution and therefore won&#8217;t be used in this tutorial. You may see both functions mentioned in other tutorials but seen as we are concentrating on looping animations setInterval is naturally the best choice for this tutorial.</p>
<h2>Setting up the CSS/HTML &#8230;</h2>
<p>So first thing to is get the initial HTML and CSS setup. All we are going to do here is set a holder div and three floated divs within. These three floated divs are going to be the elements we will loop through using setInterval.</p>
<p><strong>The initial CSS</strong></p>
<pre class="brush: css;">
.cbox { display:block;margin:5px;background:blue;opacity:0.3;width:50px;height:50px;float:left; }
.active { opacity:1; }
</pre>
<p><strong>The initial HTML</strong></p>
<pre class="brush: xml;">
&amp;lt;div id=&amp;quot;divhold&amp;quot;&amp;gt;
&amp;lt;div class=&amp;quot;cbox active&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;cbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div class=&amp;quot;cbox&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
</pre>
<p>As you can now see from the<a href="http://allcreatives.net/wp-content/uploads/2009/11/demo1.html" target="_blank"> first demo page</a> we have a very simple setup, three blue boxed divs. One at full opacity and the remaining two faded out. <strong>Note</strong> &#8211; For Internet Explorer you will need to use the following code to achieve opacity control via css. I&#8217;ve left it out of the example code to save space. As a side note jQuery takes this into consideration when performing animations.</p>
<p><strong>Opacity Control for Internet Explorer (30 = 0.3, 60 = 0.6 etc.)<br />
</strong></p>
<pre class="brush: css;">
filter: alpha(opacity = 30);
</pre>
<p>Also in the initial html/css we have added a class of active to the very first div, this will help us later on and also lets the browser know which to show as active first.</p>
<h2>Starting the loop &#8230;</h2>
<p>We now have the html in place but what we want to do is shift between all three of these boxes, each fading to full opacity whilst the one before it fades to the original opacity of 0.3.</p>
<p>This is where setInterval comes in. Now I&#8217;m sure this effect is achievable using the jQuery animation function which in itself is extremely powerful. The problem with the animation function is it becomes extremely messy extremely quickly. I&#8217;ve also found the jQuery animation function to be jittery when attempting to do too much with it.</p>
<p>So lets add the javascript in full to the <a href="http://allcreatives.net/wp-content/uploads/2009/11/demo2.html" target="_blank">second demo page</a> and I&#8217;ll break it down below. You can now see that the boxes are sliding between full opacity and partial opacity in order. The animation will stop after the final div in our holder has passed but this forms the next part of the tutorial, don&#8217;t worry about that for now. The Javascript thus far then :</p>
<p><strong>Complete Javascript to start animation off<br />
</strong></p>
<pre class="brush: jscript;">
function swapem(){

 var getnext = $(&amp;quot;#divhold .active&amp;quot;).next();
 $(&amp;quot;#divhold div&amp;quot;).fadeTo(&amp;quot;slow&amp;quot;, &amp;quot;0.3&amp;quot;, function(){ $(&amp;quot;#divhold div&amp;quot;).removeClass(&amp;quot;active&amp;quot;);getnext.fadeTo(&amp;quot;slow&amp;quot;, &amp;quot;1&amp;quot;).addClass(&amp;quot;active&amp;quot;) });

}

$(document).ready(function(){

 var divswap = setInterval('swapem()', 5000);

});
</pre>
<p>To break this down and explain a bit more about what&#8217;s happening here I&#8217;ll start with the very first Javascript function we&#8217;ve written &#8211; &#8217;swapem&#8217; :</p>
<p><strong>Just the initial &#8217;swapem&#8217; function from the animation code above</strong></p>
<pre class="brush: jscript;">
function swapem(){

 var getnext = $(&amp;quot;#divhold .active&amp;quot;).next();
 $(&amp;quot;#divhold div&amp;quot;).fadeTo(&amp;quot;slow&amp;quot;, &amp;quot;0.3&amp;quot;, function(){ $(&amp;quot;#divhold div&amp;quot;).removeClass(&amp;quot;active&amp;quot;);getnext.fadeTo(&amp;quot;slow&amp;quot;, &amp;quot;1&amp;quot;).addClass(&amp;quot;active&amp;quot;) });

}
</pre>
<p>This is the main crux of the animation. Firstly it gets the next div to be animated and places this information in the &#8216;getnext&#8217; variable. It does this by simply selecting the div after the one we currently have set to active, which of course has the class &#8216;active&#8217; we added earlier. The next line in this function is where the actual animation takes place. Firstly each div within our holder is faded to an opacity of 0.3, when this is done each div in the holder div has the class &#8216;active&#8217; removed and finally we use the &#8216;getnext&#8217; variable which has already been set to add full opacity to the div we want to show. To finish it all off the div captured in the &#8216;getnext&#8217; variable has the class name active added to it. At the moment this function hasn&#8217;t been called and isn&#8217;t doing anything, the next lines of Javascript are what starts everything off.</p>
<p><strong>The document ready function that contains our use of setInterval</strong></p>
<pre class="brush: jscript;">
$(document).ready(function(){
	var divswap = setInterval('swapem()', 5000);
});
</pre>
<p>The document ready function you should already be familiar with. When the document is ready we create a variable that will hold the information of our setInterval function. At the same time the setInterval function begins running. It is instructed to run the &#8217;swapem&#8217; function we first created every 5000 milliseconds. Both of these function parameters can be changed to whatever you would like them to be, for instance if our function went by a different name. Every 1000 milliseconds are equal to one whole second so our 5000 equals 5 seconds, 10000 would equal 10 seconds and so on.</p>
<h2>Controlling the looping</h2>
<p>So now in <a href="http://allcreatives.net/wp-content/uploads/2009/11/demo2.html" target="_blank">the second demo page</a> we have a piece of Javascript working that starts a loop to animate the transition between opacity&#8217;s of 0.3 and 1 in order. At the moment however we have no genuine loop, once it gets to the last div in our holder it just stops. This is isn&#8217;t the fault of our setInterval, setInterval will just keep hitting the function every 5 seconds until we tell it to stop (which we&#8217;ll do later). The problem is with the &#8217;swapem&#8217; function. When the function reaches the third div under the holder div there is no next div to find because it doesn&#8217;t exist. What we now need our function to do is recognise when its at the end of child divs and start from the beginning at this point.</p>
<p>Take a look at the <a href="http://allcreatives.net/wp-content/uploads/2009/11/demo3.html" target="_blank">third demo page</a>. This page contains a few additional lines of Javascript in our &#8217;swapem&#8217; function to get the currently active div, identified by having the class &#8216;active&#8217;. When the active div is identified we then check to see if it is the last element in the div holder, if it is we reset the &#8216;getnext&#8217; variable to very first div in the holder. If it isn&#8217;t then the function carries on as normal looping through to the next div in line. This addition will now gives us animation looping continually.</p>
<p>Below is the revised &#8217;swapem&#8217; function, nothing else on the third demo page differs from the second apart from the additional lines of code from line 4 to 7. This is what gives you the information a describing above.</p>
<p><strong>Revised Javascript to detect end of loop and start over</strong></p>
<pre class="brush: jscript;">
function swapem(){

	var getnext = $(&amp;quot;#divhold .active&amp;quot;).next();
	var current = $(&amp;quot;#divhold .active&amp;quot;);
	if(current.is(':last-child')){
	var getnext = $(&amp;quot;#divhold div:first-child&amp;quot;);
	}
	$(&amp;quot;#divhold div&amp;quot;).fadeTo(&amp;quot;slow&amp;quot;, &amp;quot;0.3&amp;quot;, function(){ $(&amp;quot;#divhold div&amp;quot;).removeClass(&amp;quot;active&amp;quot;);getnext.fadeTo(&amp;quot;slow&amp;quot;, &amp;quot;1&amp;quot;).addClass(&amp;quot;active&amp;quot;) });

}
</pre>
<h2>Stopping and Starting the loop</h2>
<p>Now we have the loop working just as we want it we need a way to stop it. clearInterval takes care of this for us. We can use the clearInterval function anywhere we want it such as separate button away from the holder div or when a visitor mouses over one of the blue boxes. Take a look at the <a href="http://allcreatives.net/wp-content/uploads/2009/11/demo4.html" target="_blank">fourth and final demo page</a> to see a number of different options to stop our loop and start it again.</p>
<p><strong>clearInterval function</strong></p>
<pre class="brush: jscript;">
clearInterval(divswap);
</pre>
<p>The clearInterval function takes in the variable name we assigned to setInterval earlier and stops it completely. You can use the function on hover or click or any other Javascript you like.</p>
<p><strong>clearInterval on mouseenter</strong></p>
<pre class="brush: jscript;">
$(&amp;quot;.cbox&amp;quot;).mouseenter(function(){
		clearInterval(divswap);
	});
</pre>
<p>To start it again we simply use the same function we used in the first document ready instance.</p>
<p><strong>Original setInterval start code</strong></p>
<pre class="brush: jscript;">
var divswap = setInterval('swapem()', 5000);
</pre>
<p>This too can be dropped inside of any Javascript event.</p>
<p><strong>Starting the loop again onClick</strong></p>
<pre class="brush: jscript;">
$(&amp;quot;.start&amp;quot;).click(function(){
	var divswap = setInterval('swapem()', 5000);
			return false;
	});
</pre>
<h2>Applying this to sites in the wild &#8230;</h2>
<p>I&#8217;m hoping this basic tutorial has given you a good starting point for something more advanced. The &#8216;blue boxes&#8217; used in the demo pages of this tutorial could potentially be any style you wanted and could contain any number of child elements. The beauty of creating something like this from barebone code as provided here is that you don&#8217;t get plug-ins packed full of features that you&#8217;ll never need and you&#8217;ll always know where you are in the code.</p>
<p>If there are any questions feel free to ask away in the comments.</p>
<p><strong>Demo Pages Recap :</strong></p>
<ul>
<li><a href="http://allcreatives.net/wp-content/uploads/2009/11/demo1.html" target="_blank">Demo page one </a>- Setting up the html and css</li>
<li><a href="http://allcreatives.net/wp-content/uploads/2009/11/demo2.html" target="_blank">Demo page two</a> &#8211; Adding the animation and initial loop</li>
<li><a href="http://allcreatives.net/wp-content/uploads/2009/11/demo3.html" target="_blank">Demo page three</a> &#8211; Adding continuous animation</li>
<li><a href="http://allcreatives.net/wp-content/uploads/2009/11/demo4.html" target="_blank">Demo page four</a> &#8211; Adding animation controls</li>
<li><a href="http://allcreatives.net/wp-content/uploads/2009/11/LoopingAnimations.zip" target="_blank">Download all four demo pages</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/11/10/combining-javascript-setinterval-and-jquery-for-lovely-looping-animations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
