<?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>Creative Individual Design Blog &#187; Tutorials</title>
	<atom:link href="https://creativeindividual.co.uk/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>https://creativeindividual.co.uk</link>
	<description>A Place of Inspiration</description>
	<lastBuildDate>Wed, 21 Aug 2019 17:33:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4</generator>
		<item>
		<title>Create a jQuery Tooltip!</title>
		<link>https://creativeindividual.co.uk/2012/11/create-a-jquery-tooltip/</link>
		<comments>https://creativeindividual.co.uk/2012/11/create-a-jquery-tooltip/#comments</comments>
		<pubDate>Sun, 25 Nov 2012 13:40:55 +0000</pubDate>
		<dc:creator>Laura Montgomery</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://creativeindividual.co.uk/?p=361</guid>
		<description><![CDATA[<a href="/2012/11/create-a-jquery-tooltip" title="Create a jQuery Tooltip"><img src="/wp-content/uploads/2012/11/banner.jpg" /></a>

In this article I am going to show you how to create a simple <strong>Tooltip</strong> effect using jQuery. What's great about this method is that it degrades gracefully, so if someone doesn't have Javascript enabled they don't see anything out of place.

The tooltip that we will be creating will appear when we hover over a link. We will use the HTML5 <strong>custom data attribute</strong> (data-*) to hold our information, then use jQuery to dynamically create a container (div) to hold the information within the custom data attribute.

This tutorial assumes that you have some understanding of jQuery but I'll be explaining everything as we go so should be good for beginners as well. You will also need to understand HTML and CSS.]]></description>
			<content:encoded><![CDATA[<p>In this article I am going to show you how to create a simple <strong>Tooltip</strong> effect using <a title="jQuery - Category" href="/category/jquery/">jQuery</a>. What&#8217;s great about this method is that it degrades gracefully, so if someone doesn&#8217;t have Javascript enabled they don&#8217;t see anything out of place.</p>
<p>This tutorial assumes that you have some understanding of jQuery but I&#8217;ll be explaining everything as we go so should be good for beginners as well. You will also need to understand HTML and CSS.</p>
<p>I&#8217;ve included the finished files and a demo so you can see what we are going to achieve.</p>
<h2>The Technique</h2>
<p>The tooltip that we will be creating will appear when we hover over a link. We will use the HTML5 <a title="HTML5 custom data attributes" href="http://dev.w3.org/html5/spec/global-attributes.html#embedding-custom-non-visible-data-with-the-data-*-attributes">custom data attribute</a> (data-*) to hold our information, then use jQuery to dynamically create a container (div) to hold the information within the custom data attribute.</p>
<h2>Tutorial Demo</h2>
<p>Still not sure what we are trying to achieve? Just click the image below to view the demo:</p>
<p><a href="http://creativeindividual.co.uk/wp-content/uploads/2012/tooltip/"><img class="alignnone size-full wp-image-362" title="Create a jQuery Tooltip - Tutorial Demo" src="http://creativeindividual.co.uk/wp-content/uploads/2012/11/preview.jpg" alt="Create a jQuery Tooltip - Tutorial Demo" width="648" height="406" /></a></p>
<div class="view-tutorial-demo"><a title="Create a jQuery Tooltip - Tutorial Demo" href="http://creativeindividual.co.uk/wp-content/uploads/2012/tooltip/">View the Tutorial Demo</a></div>
<h2>The HTML</h2>
<p>OK, first create a new HTML file and insert the usual DOCTYPE, html, head, etc. information. Notice I am using the HTML5 DOCTYPE.</p>
<pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;Tooltip Demo&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Add links to your CSS and Tooltip JS files, and create these files. I&#8217;ve used <strong>layout.css</strong> and <strong>tooltip.js</strong> respectively. You will also need to link to a hosted jQuery library or host your own. I personally prefer to link to Google but use whichever option is best for you and your project.</p>
<pre>...
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;Tooltip Demo&lt;/title&gt;
    &lt;link rel="stylesheet" href="layout.css" type="text/css" /&gt;
    &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="tooltip.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
...</pre>
<p>Now, add a link (&lt;a href&#8230;) with all the usual attributes. I am using the hash symbol (#) because this is a test and I don&#8217;t want this link to go anywhere but this script works perfectly with real links.</p>
<pre>...
&lt;body&gt;
  &lt;a href="#" title="My Link Title"&gt;My Link&lt;/a&gt;
&lt;/body&gt;
...</pre>
<p>Finally, add our custom data attribute. For readability I am using <strong>data-tooltip</strong> but feel free to use something which better describes your content.</p>
<pre>...
&lt;body&gt;
  &lt;a href="#" title="My Link Title" data-tooltip="My Tooltip Text"&gt;My Link&lt;/a&gt;
&lt;/body&gt;
...</pre>
<p>And that&#8217;s it for the HTML. Pretty simple right? The CSS is even easier&#8230;</p>
<h2>The CSS</h2>
<p>Our tooltip will have an <strong>ID of tooltip</strong>. This isn&#8217;t obvious from the HTML because this div will be created dynamically by our jQuery script, so just take my word for it for now &#8211; all will become clear in a minute. For our CSS we actually only need to add two styles to <strong>div#tooltip</strong> for the basic tooltip effect, <strong>position</strong> and <strong>z-index</strong>. Add the following to <strong>layout.css</strong>:</p>
<pre>div#tooltip {
  position: absolute;
  z-index: 10;
}</pre>
<p>In the demo (and downloadable files) I&#8217;ve also added some basic styling such as background, color, padding and even box shadow to improve the effect, but I&#8217;ll leave this up to you to style the tooltip to suit your site design.</p>
<h2>The jQuery</h2>
<p>Open up <strong>tooltip.js</strong> and write out the document ready function &#8211; feel free to use the shorter version but for readability I will use the full function.</p>
<pre>$(document).ready(function() {
});</pre>
<p>Next we want to target any element with an attribute of <strong>data-tooltip</strong>, so this will be our selector. The action will be <strong>.hover</strong>.</p>
<pre>$(document).ready(function() {
  $("[data-tooltip]").hover(
    function() {
    }
  );
});</pre>
<p>We first want to create the div which will hold our tooltip information. Remember from above that this will be a div with an ID of tooltip. We will use <strong>.before</strong> to position this div before our link in the DOM. This is why position and z-index are so important in our CSS &#8211; these position the tooltip div visually above our link (and other content) and stops any nasty content jumping from occurring. <em>Note the single quotes used.</em></p>
<pre>$(document).ready(function() {
  $("[data-tooltip]").hover(
    function() {
      $(this).before('&lt;div id="tooltip"&gt;&lt;/div&gt;')
    }
  );
});</pre>
<p>Next we want to get the information from our data attribute and store it in a variable. I have put this variable above the previous line which is good practice, especially in cases where I would be using more than one variable, i.e. keeping them together.</p>
<pre>$(document).ready(function() {
  $("[data-tooltip]").hover(
    function() {
      var tooltip = $(this).attr("data-tooltip");
      $(this).before('&lt;div id="tooltip"&gt;&lt;/div&gt;')
    }
  );
});</pre>
<p>Finally, we want to add the information stored in our variable to our new div. We can use <strong>.text</strong> to achieve this.</p>
<pre>$(document).ready(function() {
  $("[data-tooltip]").hover(
    function() {
      var tooltip = $(this).attr("data-tooltip");
      $(this).before('&lt;div id="tooltip"&gt;&lt;/div&gt;')
      $("div#tooltip").text(tooltip);
    }
  );
});</pre>
<p>If you have any basic knowledge of jQuery you will know that <strong>.hover</strong> also includes <strong>hover off</strong> within the action. Let&#8217;s make use of that now to delete the tooltip div when we move our mouse cursor off the link. We simply need to use <strong>.remove</strong> to achieve this.</p>
<pre>$(document).ready(function() {
  $("[data-tooltip]").hover(
    function() {
      var tooltip = $(this).attr("data-tooltip");
      $(this).before('&lt;div id="tooltip"&gt;&lt;/div&gt;')
      $("div#tooltip").text(tooltip);
    },
    function() {
      $("div#tooltip").remove();
    }
  );
});</pre>
<p>We are almost done. The last part is to get the tooltip div to follow our mouse cursor as it moves around the link. I have used a similar effect in a <a title="Create a Pop-up div in jQuery" href="http://creativeindividual.co.uk/2011/02/create-a-pop-up-div-in-jquery/">previous post</a>. First we want to create two variables which will tell the div how far away from our cursor to move so that we can easily see all of the text.</p>
<pre>$(document).ready(function() {
  var moveLeft = 20;
  var moveDown = 10;
  $("[data-tooltip]").hover(
    ...
  );
});</pre>
<p>The action of the tooltip div moving occurs when we move our mouse cursor around on the link with the data attribute, so this is what we will be targeting with the <strong>.mousemove</strong> action.</p>
<pre>$(document).ready(function() {
  var moveLeft = 20;
  var moveDown = 10;
  $("[data-tooltip]").hover(
    ...
  );
  $("data-tooltip").mousemove(function() {
  });
});</pre>
<p>We then just need to use <strong>.css</strong> on our tooltip div to move it from the <strong>top</strong> and from the <strong>left</strong> &#8211; remember that we used <strong>position: absolute</strong> in our CSS, this is coming into play again.</p>
<pre>$(document).ready(function() {
  var moveLeft = 20;
  var moveDown = 10;
  $("[data-tooltip]").hover(
    ...
  );
  $("data-tooltip").mousemove(function() {
    $("div#tooltip").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
  });
});</pre>
<p>We have one small update to do to our code to finish. Notice the <strong>e</strong> used  - i.e. e.pageY and e.pageX. We simply need to add e between the parenthesis of each of our functions. See the full complete code below:</p>
<pre>$(document).ready(function() {
  var moveLeft = 20;
  var moveDown = 10;
  $("[data-tooltip]").hover(
    function(e) {
      var tooltip = $(this).attr("data-tooltip");
      $(this).before('&lt;div id="tooltip"&gt;&lt;/div&gt;')
      $("div#tooltip").text(tooltip);
    },
    function(e) {
      $("div#tooltip").remove();
    }
  );
  $("[data-tooltip]").mousemove(function(e) {
    $("div#tooltip").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
  });
});</pre>
<p>Load up your HTML page and check out the script in action.</p>
<p><strong>That&#8217;s it!</strong></p>
<p><a href="http://creativeindividual.co.uk/wp-content/uploads/2012/tooltip/"><img class="alignnone size-full wp-image-362" title="Create a jQuery Tooltip - Tutorial Demo" src="http://creativeindividual.co.uk/wp-content/uploads/2012/11/preview.jpg" alt="Create a jQuery Tooltip - Tutorial Demo" width="648" height="406" /></a></p>
<div class="view-tutorial-demo"><a title="Create a jQuery Tooltip - Tutorial Demo" href="http://creativeindividual.co.uk/wp-content/uploads/2012/tooltip/">View the Tutorial Demo</a></div>
<h2>Get The Source Code</h2>
<p>You can download the complete tutorial source code by clicking on the big button below and unzipping the file.</p>
<p><a href="http://creativeindividual.co.uk/wp-content/uploads/2012/tooltip/tooltip.zip"><img class="alignnone size-full wp-image-108" title="Download Source File - jQuery Tutorial - Create a jQuery Tooltip" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/download-source-file.png" alt="" width="648" height="104" /></a></p>
]]></content:encoded>
			<wfw:commentRss>https://creativeindividual.co.uk/2012/11/create-a-jquery-tooltip/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>jQuery 101 &#8211; Learning the Basics</title>
		<link>https://creativeindividual.co.uk/2012/06/jquery-101-learning-the-basics/</link>
		<comments>https://creativeindividual.co.uk/2012/06/jquery-101-learning-the-basics/#comments</comments>
		<pubDate>Sun, 17 Jun 2012 17:26:52 +0000</pubDate>
		<dc:creator>Laura Montgomery</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://creativeindividual.co.uk/?p=354</guid>
		<description><![CDATA[<a href="/2012/06/jquery-101-learning-the-basics/" title="jQuery 101 - Learning the Basics"><img src="/wp-content/uploads/2010/10/jquery_banner.jpg" /></a>

By now most web designers and developers have a very good understanding of jQuery and its capabilities; for most it is their go to JavaScript library when adding some additional functionality or interactivity to their web pages.

However there are still plenty of people out there who are new to web development and who would like to get started with this great language but don’t know how to.

<em>Well, this one’s for you!</em>

In this tutorial aimed at absolute jQuery beginners you'll learn about:

<ul>
<li>What is jQuery?</li>
<li>Installing the jQuery Library</li>
<li>The Document Ready function</li>
<li>.click() and .hide()</li>
<li>Understanding the Syntax</li>
<li>.toggle()</li>
<li>.slideToggle() and .find()</li>
<li>Animation Speed</li>
<li>.css(), this Selector and Basic Selector Filters</li>
<li>.hasClass(), .addClass(), .removeClass() and if Statements</li>
</ul>

Lots for the absolute beginner to get stuck into and see what the world of jQuery has to offer.]]></description>
			<content:encoded><![CDATA[<p>By now most web designers and developers have a very good understanding of jQuery and its capabilities; for most it is their go to JavaScript library when adding some additional functionality or interactivity to their web pages.</p>
<p>However there are still plenty of people out there who are new to web development and who would like to get started with this great language but don&#8217;t know how to.</p>
<p><em>Well, this one&#8217;s for you!</em></p>
<h2>What is jQuery?</h2>
<p>In essence, jQuery is a powerful JavaScript library which makes life a lot easier for those of us with little (or no) JavaScript knowledge. It allows us to add JavaScript functionality to a web page using much simpler code. jQuery is particularly apt at adding event-handling, transversing, animations or Ajax interactions to a web page.</p>
<p>I don&#8217;t know about you, but that all sounds rather confusing and boring&#8230; But believe me it&#8217;s not! And once you get a basic understanding of jQuery, you&#8217;ll be WOW-ing yourself in no time. And the best way to get this basic understanding is just to get started.</p>
<p><em>Are you ready?</em></p>
<h2>Installing the jQuery Library</h2>
<p>To make use of jQuery you first need to make the script available to your webpage. There are a few options available when adding the jQuery library to your webpage but they basically breakdown into two options:</p>
<ul>
<li>Downloading the latest source file and hosting it on your own website/server.</li>
<li>Linking to hosted files such as those on jQuery&#8217;s own site, on Google&#8217;s Libraries API or a few other hosted options.</li>
</ul>
<p>Personally I almost always opt for linking to files hosted on an external source unless for some reason I am developing without an internet connection, and that pretty much doesn&#8217;t happen to me anymore! So I am going to show you how to implement the hosted option. So break open your favourite text editor and let&#8217;s get started.</p>
<p>Let&#8217;s create the basic HTML page structure first:</p>
<pre>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;jQuery 101 - Learning the Basics&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;!-- My page content will go here --&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
<p>We are going to link to Google&#8217;s latest (at time of writing) stable copy of jQuery. A quick search of &#8220;google jquery&#8221; should find the page you are looking for but for reference purposes it is:</p>
<p><a title="Google Libraries API" href="https://developers.google.com/speed/libraries/devguide" target="_blank">https://developers.google.com/speed/libraries/devguide</a></p>
<p>Click on the jQuery (not jQuery UI) link in the table of contents. You are looking for the source path which references jquery.min.js. This is the compressed version of the file and will save you quite a bit of loading time &#8211; this is allows a good thing.</p>
<p>Now that we&#8217;ve got our reference, let&#8217;s add it to our page:</p>
<pre>...
&lt;head&gt;
    &lt;title&gt;jQuery 101 - Learning the Basics&lt;/title&gt;
    &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
...</pre>
<p><em>That&#8217;s it! How easy was that?</em></p>
<h2>Your First jQuery Function</h2>
<p>Now that the library is loaded onto our page, let&#8217;s prepare the page for our first jQuery function. Almost all jQuery code that you write will start with this function. It is the Document Ready function and basically it stops jQuery from running until the webpage has finished loading.</p>
<pre>...
&lt;head&gt;
    &lt;title&gt;jQuery 101 - Learning the Basics&lt;/title&gt;
    &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        // This is a JavaScript comment
        // Load the Document Ready function
        $(document).ready(function(){
          // The rest of our jQuery will go in here
        });
    &lt;/script&gt;
&lt;/head&gt;
...</pre>
<p>Now that we have the boring bit done, let&#8217;s see what jQuery can do.</p>
<h2>Your Second jQuery Function</h2>
<p>Let&#8217;s create a paragraph with a link that hides the paragraph when clicked. Really very simple stuff with jQuery.</p>
<p>First let&#8217;s add the paragraph and link between the body tags:</p>
<pre>...
&lt;body&gt;
    &lt;p class="disappear"&gt;
        This paragraph will disappear when you click
        &lt;a href="#" class="make-disappear"&gt;this link&lt;/a&gt;.
    &lt;/p&gt;
&lt;/body&gt;
...</pre>
<p>Now let&#8217;s add our jQuery:</p>
<pre>...
$(document).ready(function(){
    $("a.make-disappear").click(function(){
        $("p.disappear").hide();
    });
});
...</pre>
<p>Save your code as a HTML document (such as index.html) and load the page in your favourite web browser (such as Google Chrome or Internet Explorer). Now click the link to see your script run by hiding the paragraph.</p>
<p><em>Amazing!</em></p>
<div class="view-tutorial-demo"><a title="jQuery 101 - Learning the Basics - Demo" href="http://creativeindividual.co.uk/wp-content/uploads/2012/jquery-101/">View the Tutorial Demo</a></div>
<h2>Understanding the Syntax</h2>
<p>Now that you have some code to look at, let&#8217;s try and understand what it&#8217;s doing by understanding the basic jQuery syntax. Every function in jQuery follows this basic structure, or syntax:</p>
<p>Basic Syntax:<strong> $(selector).action();</strong></p>
<p>Let&#8217;s break it down:</p>
<ul>
<li>The <strong>$</strong> (dollar sign) defines jQuery. Other JavaScript libraries also make use of this sign so if you are mixing libraries you can use <strong>jQuery</strong> instead.</li>
<li><strong>(selector)</strong> finds or queries elements in the HTML. So in our example the selector is <strong>(&#8220;a.make-disappear&#8221;)</strong> which tells jQuery to look for a hyperlink (a tag) with a class of make-disappear. The selector uses CSS syntax to query the DOM, such as .classname for classes and #idname for ids.</li>
<li><strong>.action()</strong> is the jQuery action to be performed on the HTML elements. So in our example the action is <strong>.click()</strong>, in other words when the user performs a click on the link. We then run another function within the .click() action.</li>
</ul>
<p>Our Syntax: <strong>$(selector).action(function(){$(selector).action();});</strong></p>
<ul>
<li>Within our .click() action we run another function by using <strong>function(){}</strong> and within this function we use <strong>$(selector).action();</strong> again.</li>
<li>Our second selector is <strong>(&#8220;p.disappear&#8221;)</strong> which tells us that when a link with the class of make-disappear is clicked, look for any paragraphs (p tag) with a class of disappear.</li>
<li>Our second action is <strong>.hide()</strong>. What this tells jQuery to do is that when a hyperlink with a class of make-disappear is clicked, look of any paragraphs with a class of disappear and hide them.</li>
</ul>
<h2>Some Basic Events</h2>
<p>Now that we have an understanding of our second jQuery function &#8211; making a paragraph disappear when we click a link &#8211; let&#8217;s look at some more basic events.</p>
<h3>.toggle()</h3>
<p>The .toggle() action combines the .hide() and .show() actions. Let&#8217;s create another link which toggles a span:</p>
<pre>...
&lt;body&gt;
    ...
    &lt;p class="toggle"&gt;
        &lt;a href="#"&gt;Show/Hide&lt;/a&gt;
        &lt;span&gt;This text will appear and disappear.&lt;/span&gt;
    &lt;/p&gt;
&lt;/body&gt;
...</pre>
<p>Now let&#8217;s add our jQuery:</p>
<pre>...
$(document).ready(function(){
    ...
    $("p.toggle a").click(function(){
        $("p.toggle span").toggle();
    });
});
...</pre>
<p>Save your file again and refresh your browser. By clicking the link you can show and hide the text wrapped in the span tag. <em>Magic!</em></p>
<div class="view-tutorial-demo"><a title="jQuery 101 - Learning the Basics - Demo" href="http://creativeindividual.co.uk/wp-content/uploads/2012/jquery-101/">View the Tutorial Demo</a></div>
<p>In the jQuery code above, instead of giving each element a class or id, I&#8217;ve only given the paragraph tag a class of toggle and then referenced other elements within the paragraph, just like you would with CSS. So by clicking the link within the paragraph with a class of toggle, we can show and hide the span within the paragraph.</p>
<p>All this is very nice, but we can do better than this! Introducing the .slideToggle() effect.</p>
<h3>.slideToggle() and .find()</h3>
<p>Now that you&#8217;ve gotten your head around some basics, lets speed things up a bit. In our next example we are going to look at .slideToggle() and .find(). As you probably have guessed .slideToggle() is very similar to .toggle() only with a slide animation effect. We are also introducing the .find() which helps us with the selector part of our query and could make our query up to <a title="Your jQuery: Now With 67% Less Suck" href="http://24ways.org/2011/your-jquery-now-with-less-suck" target="_blank">twice as fast</a>.</p>
<p>Let&#8217;s duplicate our previous code and instead of the paragraph having a class of toggle we&#8217;ll give it a class of slideToggle:</p>
<pre>...
&lt;body&gt;
    ...
    &lt;p class="slideToggle"&gt;
        &lt;a href="#"&gt;Show/Hide&lt;/a&gt;
        &lt;span&gt;This text will appear and disappear.&lt;/span&gt;
    &lt;/p&gt;
&lt;/body&gt;
...</pre>
<p>Now let&#8217;s add our jQuery:</p>
<pre>...
$(document).ready(function(){
    ...
    $("p.slideToggle").find("a").click(function(){
        $("p.slideToggle").find("span").slideToggle();
    });
});
...</pre>
<p>Save your file again and refresh your browser to see the .slideToggle() effect. <em>Pretty sweet!</em> But we can <strong>still</strong> do better than that!</p>
<div class="view-tutorial-demo"><a title="jQuery 101 - Learning the Basics - Demo" href="http://creativeindividual.co.uk/wp-content/uploads/2012/jquery-101/">View the Tutorial Demo</a></div>
<h3>Animation Speed</h3>
<p>A lot of actions, including .slideToggle, allow us to dictate the speed of the animation. There are a few options available:</p>
<ul>
<li>slow (600 milliseconds)</li>
<li>normal (400 milliseconds)</li>
<li>fast (200 milliseconds)</li>
<li>a custom speed in milliseconds</li>
</ul>
<p>Let&#8217;s update our jQuery by adding the fast speed:</p>
<pre>...
$(document).ready(function(){
    ...
    $("p.slideToggle").find("a").click(function(){
        $("p.slideToggle").find("span").slideToggle(<strong>"fast"</strong>);
    });
});
...</pre>
<p>Once again, save your file and refresh your browser.</p>
<p>Notice that we put the word fast in quotes in our code above. The same goes for normal and slow. However if we want to dictate our speed in milliseconds we just enter the number, like so:</p>
<pre>...
$(document).ready(function(){
    ...
    $("p.slideToggle").find("a").click(function(){
        $("p.slideToggle").find("span").slideToggle(<strong>1000</strong>);
    });
});
...</pre>
<p>Our .slideToggle() effect will now take 1 second (1000 milliseconds) to complete.</p>
<h3>.css(), this Selector and Basic Selector Filters</h3>
<p>Let&#8217;s push the boat out again with our jQuery. In our next example we are going to look at one new action, the this selector and some basic selector filters. The action is .css() and as you can imagine, this allows us to add or edit CSS properties to our DOM elements. The this selector allows us to target the element which has been actioned, such as through .click(). The basic selector filters we will be looking at are :even, :odd and :last, and these allow us to target even numbered elements, odd numbers elements and the last element in our given query.</p>
<p>In our next example we are going to create a checklist. That is, an unordered list with zebra strips and a function which allows us to click on a list item and change its colour plus put a line-through the text, showing that this item has been completed.</p>
<p>On a side note, this example is for the purposes of showing how something <strong>could</strong> be done and not how it <strong>should</strong> be done &#8211; we&#8217;ll get to that later.</p>
<p>OK, first let&#8217;s create our simple list:</p>
<pre>...
&lt;body&gt;
    ...
    &lt;ul class="list1"&gt;
        &lt;li&gt;List item 1&lt;/li&gt;
        &lt;li&gt;List item 2&lt;/li&gt;
        &lt;li&gt;List item 3&lt;/li&gt;
        &lt;li&gt;List item 4&lt;/li&gt;
        &lt;li&gt;List item 5&lt;/li&gt;
        &lt;li&gt;List item 6&lt;/li&gt;
    &lt;/ul&gt;
&lt;/body&gt;
...</pre>
<p>Now let&#8217;s style our list items using .css(). First let&#8217;s give each item some padding:</p>
<pre>...
$(document).ready(function(){
    ...
    $("ul.list1").find("li").css("padding","5px");
});
...</pre>
<p>Notice we are just running our usual selector with the .find() action and finally we are adding one CSS property to all the unordered lists-items &#8211; padding of 5 pixels on all sides.</p>
<p>Next let&#8217;s target all our even list items. Remember that arrays start with 0 so technically our first list item is even, not odd as you would expect. We&#8217;ll use the :even filter to do this:</p>
<pre>...
$(document).ready(function(){
    ...
    $("ul.list1").find("li").css("padding","5px");

   <strong> $("ul.list1").find("li:even").css({</strong>
       <strong> "border-top":"1px solid #eee",</strong>
       <strong> "background":"#fcfcfc"</strong>
   <strong> });</strong>
});
...</pre>
<p>Notice that this time our .css() action is a little different because we are specifying more than one CSS property. Make sure to remember this so that you don&#8217;t get tripped up in the future.</p>
<p>Now let&#8217;s style the other items in our list using the :odd selector filter:</p>
<pre>...
$(document).ready(function(){
    ...
    $("ul.list1").find("li").css("padding","5px");

    $("ul.list1").find("li:even").css({
        "border-top":"1px solid #eee",
        "background":"#fcfcfc"
    });

   <strong> $("ul.list1").find("li:odd").css({ </strong>
       <strong> "border-top":"1px solid #d3e9ff", </strong>
       <strong> "background":"#e8f3ff" </strong>
   <strong> }); </strong>});
...</pre>
<p>And finally let&#8217;s add another border at the bottom of the last list item using :last:</p>
<pre>...
$(document).ready(function(){
    ...
    $("ul.list1").find("li").css("padding","5px");

    $("ul.list1").find("li:even").css({
        "border-top":"1px solid #eee",
        "background":"#fcfcfc"
    });

    $("ul.list1").find("li:odd").css({
        "border-top":"1px solid #d3e9ff",
        "background":"#e8f3ff"
    });

    <strong>$("ul.list1").find("li:last").css("border-bottom","1px solid #d3e9ff"); </strong>
});
...</pre>
<p>If you save your document and refresh your browser you will see that we have created a very simple zebra strip effect.</p>
<p>Now let&#8217;s create our checklist functionality by using the <strong>this</strong> selector:</p>
<pre>...
$(document).ready(function(){
    ...
    $("ul.list1").find("li").css("padding","5px");

    $("ul.list1").find("li:even").css({
        "border-top":"1px solid #eee",
        "background":"#fcfcfc"
    });

    $("ul.list1").find("li:odd").css({
        "border-top":"1px solid #d3e9ff",
        "background":"#e8f3ff"
    });

    $("ul.list1").find("li:last").css("border-bottom","1px solid #d3e9ff");

    <strong>$("ul.list1").find("li").click(function(){</strong>
        <strong>$(this).css({</strong>
            <strong>"border-top":"1px solid #fcf47e",</strong>
            <strong>"background":"#ffffea",</strong>
            <strong>"text-decoration":"line-through"</strong>
        <strong>});</strong>
    <strong>});</strong>

});
...</pre>
<p>In this last query what we are asking jQuery to do is get any unordered lists with a class of list1 (ul.list1), find all the list items (li) within the unordered list, then, if any of the list items are clicked, apply the css following css styles <strong>only</strong> to the item that was clicked (this). Got it? Great, go check it out in your browser.</p>
<div class="view-tutorial-demo"><a title="jQuery 101 - Learning the Basics - Demo" href="http://creativeindividual.co.uk/wp-content/uploads/2012/jquery-101/">View the Tutorial Demo</a></div>
<h3>.hasClass(), .addClass(), .removeClass() and if Statements</h3>
<p>Remember how I said that the last example showed how a checklist function <strong>could</strong> be done but it wasn&#8217;t how it <strong>should</strong> be done? Well let&#8217;s learn how it should be done and while we are at it we&#8217;ll learn about .hasClass(), .addClass(), .removeClass() and JavaScript if statements, plus also add the functionality to unselect items too. <em>Exciting, eh?</em></p>
<p>OK, first duplicate the unordered list items from the previous example and give it a class of list2.</p>
<pre>...
&lt;body&gt;
    ...
    &lt;ul&gt;
        &lt;li&gt;List item 1&lt;/li&gt;
        &lt;li&gt;List item 2&lt;/li&gt;
        &lt;li&gt;List item 3&lt;/li&gt;
        &lt;li&gt;List item 4&lt;/li&gt;
        &lt;li&gt;List item 5&lt;/li&gt;
        &lt;li&gt;List item 6&lt;/li&gt;
    &lt;/ul&gt;
&lt;/body&gt;
...</pre>
<p>Easy so far. Next we are going to style our list using CSS rather than jQuery. So we need to create a stylesheet and link to it in our HTML head:</p>
<pre>...
&lt;head&gt;
    &lt;title&gt;jQuery 101 - Learning the Basics&lt;/title&gt;
    &lt;link rel="stylesheet" type="text/css" href="styles.css" /&gt;
    ...
&lt;/head&gt;
...</pre>
<p>OK, next add the following styles to your stylesheet. These will look very familiar to you as they are the same styles that we used in the last example. The only difference to note is that I&#8217;ve swapped around the styles for odd list items and even list items. Notice that we are using <a title="CSS3 Pseudo-classes: Harnessing the power!" href="http://creativeindividual.co.uk/2011/08/css3-pseudo-classes/">CSS3 Pseudo-classes</a>.</p>
<pre>ul.list2 li { padding: 5px; cursor: pointer; }
ul.list2 li:nth-of-type(odd) { border-top: 1px solid #eee; background: #fcfcfc; }
ul.list2 li:nth-of-type(even) { border-top: 1px solid #d3e9ff; background: #e8f3ff; }
ul.list2 li:last-of-type { border-bottom:1px solid #d3e9ff; }
ul.list2 li.completed { border-top: 1px solid #fcf47e; background: #ffffea; text-decoration: line-through; }</pre>
<p>We are almost done. Now just for our jQuery. We are going to run the same query as before. jQuery will find all the unordered lists with a class of list2, then will find all the list items within the unordered list. This time when the user clicks on a list item the jQuery will run an if statement. It will check if the list item has a class of completed by using .hasClass(), and if so will remove the class using .removeClass(). If it doesn&#8217;t has a class of completed it will add the class using .addClass().</p>
<pre>...
$(document).ready(function(){
    ...
    $("ul.list2").find("li").click(function(){
        if($(this).hasClass("completed")) {
            $(this).removeClass("completed");
        } else {
            $(this).addClass("completed");
        }
    });

});
...</pre>
<p>And that&#8217;s it. Go check it out in your browser.</p>
<div class="view-tutorial-demo"><a title="jQuery 101 - Learning the Basics - Demo" href="http://creativeindividual.co.uk/wp-content/uploads/2012/jquery-101/">View the Tutorial Demo</a></div>
<h2>Conclusion</h2>
<p>Hopefully by the time you&#8217;ve completed this tutorial you&#8217;ll have some good basics about jQuery and how to use it. This tutorial only scratches the surface and you&#8217;ve only just begun to delve into the exciting world of jQuery.</p>
<p>So &#8220;Where do I go from here?&#8221; I hear you ask. I&#8217;d recommend continuing your journey on the <a title="W3School jQuery" href="http://www.w3schools.com/jquery/default.asp" target="_blank">W3Schools jQuery tutorial</a> where you&#8217;ll cover what we&#8217;ve already learnt here, plus expand your knowledge even more by getting to grips with actions like .animate(), learning about callbacks, using Ajax and much more.</p>
<p>Not enough for you? Here&#8217;s some more useful resources:</p>
<ul>
<li><a title="jQuery Documentation" href="http://docs.jquery.com/" target="_blank">jQuery Documentation</a></li>
<li><a title="jQuery for Absolute Beginners Video Series" href="http://blog.themeforest.net/tutorials/jquery-for-absolute-beginners-video-series/" target="_blank">jQuery for Absolute Beginners Video Series</a></li>
<li><a title="24 Ways - Your jQuery: Now With 67% Less Suck" href="http://24ways.org/2011/your-jquery-now-with-less-suck">24 Ways &#8211; Your jQuery: Now With 67% Less Suck</a></li>
<li><a title="A Beginner’s Guide to jQuery" href="http://creativeindividual.co.uk/2010/10/a-beginners-guide-to-jquery/" target="_blank">A Beginner’s Guide to jQuery</a></li>
</ul>
<h2>Get The Source Code</h2>
<p>You can download the complete tutorial source code by clicking on the big button below and unzipping the file.</p>
<p><a href="http://creativeindividual.co.uk/wp-content/uploads/2012/jquery-101/jquery-101.zip"><img class="alignnone size-full wp-image-108" title="Download Source File - jQuery 101 - Learning the Basics" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/download-source-file.png" alt="Download Source File - jQuery 101 - Learning the Basics" width="648" height="104" /></a></p>
]]></content:encoded>
			<wfw:commentRss>https://creativeindividual.co.uk/2012/06/jquery-101-learning-the-basics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS3 Pseudo-classes: Harnessing the power!</title>
		<link>https://creativeindividual.co.uk/2011/08/css3-pseudo-classes/</link>
		<comments>https://creativeindividual.co.uk/2011/08/css3-pseudo-classes/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 15:21:47 +0000</pubDate>
		<dc:creator>Laura Montgomery</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://creativeindividual.co.uk/?p=246</guid>
		<description><![CDATA[<a href="/2011/08/css3-pseudo-classes" title="CSS3 Pseudo-classes: Harnessing the power!"><img src="/wp-content/uploads/2011/08/css3-selectors-banner.png" /></a>

New to CSS3? Then understanding CSS3 pseudo-classes is a great place to start. This post will go into 4 common CSS3 pseudo-class selectors and explain how they work, plus how to use them. The 4 CSS3 pseudo-class selectors discussed in this post are:

<ul>
<li>:first-of-type</li>
<li>:last-of-type</li>
<li>:nth-of-type</li>
<li>:nth-last-of-type</li>
</ul>

There's is a working example included, so you can see the CSS at work!]]></description>
			<content:encoded><![CDATA[<p>If you have a passing interest in website development, or work with code everyday, there&#8217;s a pretty good chance that you&#8217;ve heard of HTML5 and CSS3 by now. There&#8217;s lots of discussion around HTML5 and how wonderful it is &#8211; and rightfully so. However I&#8217;m going to discuss some simple but power CSS3. Because let&#8217;s face it, CSS3 is where things get really exciting when developing a website.</p>
<p>This post will go into 4 of the most common (in my opinion) CSS3 pseudo-class selectors and how to use them in the real world. The 4 that I will be discussing are:</p>
<ul>
<li>:first-of-type</li>
<li>:last-of-type</li>
<li>:nth-of-type</li>
<li>:nth-last-of-type</li>
</ul>
<p>However there are lots more pseudo-classes on offer and its always worth getting a bit more familiar with them. I recommend the information on the sitepoint site for further reading:</p>
<p><a href="http://reference.sitepoint.com/css/css3psuedoclasses">http://reference.sitepoint.com/css/css3psuedoclasses</a></p>
<h2>:first-of-type</h2>
<p>If you can read English, you probably already have a pretty good idea what this CSS3 selector does. Simply, it allows you to pick the first item of a given type, such as the first list item in an unordered list.</p>
<p>Here&#8217;s a simple example of how you&#8217;d use it:</p>
<pre><strong>HTML</strong>
&lt;ul&gt;
  &lt;li&gt;First&lt;/li&gt;
  &lt;li&gt;Second&lt;/li&gt;
  &lt;li&gt;Third&lt;/li&gt;
&lt;/ul&gt;

<strong>CSS</strong>
ul li:first-of-type {
  font-weight: bold;
}</pre>
<p>The code above will create an unordered list of three items. The first item is then displayed in bold using CSS3.</p>
<p><strong>Example:</strong> <a title="CSS3 Pseudo-classes - Examples" href="http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/">http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/</a></p>
<h2>:last-of-type</h2>
<p>Similar to the :first-of-type selector, only this selector will pick the last item of a given type. So if we go back to our unordered list and simply change the CSS from :first-of-type to :last-of-type, we will see that the last item (the third in this case) is now in bold.</p>
<pre><strong>HTML</strong>
&lt;ul&gt;
  &lt;li&gt;First&lt;/li&gt;
  &lt;li&gt;Second&lt;/li&gt;
  &lt;li&gt;Third&lt;/li&gt;
&lt;/ul&gt;

<strong>CSS</strong>
ul li:last-of-type {
  font-weight: bold;
}</pre>
<p><strong>Example:</strong> <a title="CSS3 Pseudo-classes - Examples" href="http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/">http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/</a></p>
<h2>:nth-of-type</h2>
<p>Using the nth-of-type is when our CSS can get really powerful. There are several ways to use the :nth-of-type selector but I am only going to show you two. If you want to read more on the :nth-of-type, check out what sitepoint has to say:</p>
<p><a href="http://reference.sitepoint.com/css/pseudoclass-nthoftype">http://reference.sitepoint.com/css/pseudoclass-nthoftype</a></p>
<h3>:nth-of-type(3)</h3>
<p>This is the simpler form of :nth-of-type, simply declaring that we want to target <strong>only the third</strong> item of a given type. So back to our unordered list and by changing the CSS selector, only the third list item is in bold (no matter how many list items we add).</p>
<pre><strong>HTML</strong>
&lt;ul&gt;
  &lt;li&gt;First&lt;/li&gt;
  &lt;li&gt;Second&lt;/li&gt;
  &lt;li&gt;Third&lt;/li&gt;
&lt;/ul&gt;

<strong>CSS</strong>
ul li:nth-of-type(3) {
  font-weight: bold;
}</pre>
<p><strong>Example:</strong> <a title="CSS3 Pseudo-classes - Examples" href="http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/">http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/</a></p>
<h3>:nth-of-type(3n)</h3>
<p>Even more useful again is when we target every third item of a type using :nth-of-type(3n). We could change this to target every fourth, fifth, sixth, etc. by changing 3 to 4, 5, 6, etc.</p>
<p>If we create an unordered list of 6 items, you can see how :nth-of-type(3n) works:</p>
<pre><strong>HTML</strong>
&lt;ul&gt;
  &lt;li&gt;First&lt;/li&gt;
  &lt;li&gt;Second&lt;/li&gt;
  &lt;li&gt;Third&lt;/li&gt;
  &lt;li&gt;Forth&lt;/li&gt;
  &lt;li&gt;Fifth&lt;/li&gt;
  &lt;li&gt;Sixth&lt;/li&gt;
&lt;/ul&gt;

<strong>CSS</strong>
ul li:nth-of-type(3n) {
  font-weight: bold;
}</pre>
<p><strong>Example:</strong> <a title="CSS3 Pseudo-classes - Examples" href="http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/">http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/</a></p>
<p><em><strong>Note:</strong> If you want to target every second item, use <strong>:nth-of-type(even)</strong>. There is also a <strong>:nth-of-type(odd)</strong> selector.</em></p>
<h2>:nth-last-of-type</h2>
<p>After reading the last few examples, you&#8217;ve probably worked out what this selector does and how to use it. Rather than targeting just the last item of a given type, you can target the second or third last item, for example, or even the last two or three items. A really handy selector!</p>
<h3>:nth-last-of-type(3)</h3>
<p>By using :nth-last-of-type(3), we can target the third last item in our list:</p>
<pre><strong>HTML</strong>
&lt;ul&gt;
  &lt;li&gt;First&lt;/li&gt;
  &lt;li&gt;Second&lt;/li&gt;
  &lt;li&gt;Third&lt;/li&gt;
  &lt;li&gt;Forth&lt;/li&gt;
  &lt;li&gt;Fifth&lt;/li&gt;
  &lt;li&gt;Sixth&lt;/li&gt;
&lt;/ul&gt;

<strong>CSS</strong>
ul li:nth-last-of-type(3) {
  font-weight: bold;
}</pre>
<p><strong>Example:</strong> <a title="CSS3 Pseudo-classes - Examples" href="http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/">http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/</a></p>
<h3>:nth-last-of-type(-n+3)</h3>
<p>And finally, by using :nth-last-of-type(-n+3), we can target the last three items in our unordered list:</p>
<pre><strong>HTML</strong>
&lt;ul&gt;
  &lt;li&gt;First&lt;/li&gt;
  &lt;li&gt;Second&lt;/li&gt;
  &lt;li&gt;Third&lt;/li&gt;
  &lt;li&gt;Forth&lt;/li&gt;
  &lt;li&gt;Fifth&lt;/li&gt;
  &lt;li&gt;Sixth&lt;/li&gt;
&lt;/ul&gt;

<strong>CSS</strong>
ul li:nth-last-of-type(-n+3) {
  font-weight: bold;
}</pre>
<p><strong>Example:</strong> <a title="CSS3 Pseudo-classes - Examples" href="http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/">http://creativeindividual.co.uk/wp-content/uploads/2011/css3-pseudo-classes/</a></p>
<h2>Older Browsers</h2>
<p>If you are knowledgable with CSS3, you probably already realise that there is a small problem with using CSS3 pseudo-classes, and it is that older browsers will not support them!</p>
<p>Don&#8217;t let that put you off for fear not, there has already been some very clever people who have realised this problem and have used Javascript to work around it, saving our sanity in the process!</p>
<p>The Javascript that I use on a regular basis is Selectivizr, which you can read more about and download from here:</p>
<p><a href="http://selectivizr.com/">http://selectivizr.com/</a></p>
<h2>Conclusion</h2>
<p>I love the power and simplicity of CSS3 pseudo-classes. It saves us from littering our HTML and CSS with unnecessary classes just to deal with unwanted padding or margin, such as on the last paragraph of a block of text. It enables us to easily create zebra-strips on an index or list page. I find they help me a lot with fine-tuning the spacing in a grid of thumbnails on a gallery page. And they&#8217;ll definitely make your life easier when using a CMS (content management system) to stop the site from looking broken long after the initial launch.</p>
<p>As with much HTML5 and CSS3, the possibilities are only limited by your own imagination! And I hope my list of examples of four common pseudo-class selectors has given you some food for thought.</p>
<p><em>Have you have used CSS3 pseudo-classes in a recent website project? Then why not tell us about it in the comments?</em></p>
]]></content:encoded>
			<wfw:commentRss>https://creativeindividual.co.uk/2011/08/css3-pseudo-classes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create Multiple Pop-up Divs using the jQuery prev() Method</title>
		<link>https://creativeindividual.co.uk/2011/08/create-multiple-pop-up-divs-using-the-jquery-prev-method/</link>
		<comments>https://creativeindividual.co.uk/2011/08/create-multiple-pop-up-divs-using-the-jquery-prev-method/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 16:19:46 +0000</pubDate>
		<dc:creator>Laura Montgomery</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://creativeindividual.co.uk/?p=240</guid>
		<description><![CDATA[<a href="/2011/08/create-multiple-pop-up-divs-using-the-jquery-prev-method" title="Create Multiple Pop-up Divs using the jQuery prev() Method"><img src="/wp-content/uploads/2011/08/banner.png" /></a>

This is an update on a previous post that showed you how to create a simple pop-up div using jQuery. The update shows you to recreate the same effect on multiple pop-up divs using the <strong>.prev() method</strong>, meaning you can avoid duplicating the code unnecessarily.

Included in the tutorial is a demo so that you can preview the script you will be learning to write, plus the source code for you to download and keep for future reference.]]></description>
			<content:encoded><![CDATA[<p>This tutorial is an update on a previous Creative Individual jQuery tutorial &#8211; <a title="Create a Pop-up div in jQuery" href="http://creativeindividual.co.uk/2011/02/create-a-pop-up-div-in-jquery/">Create a Pop-up div in jQuery</a>. The first tutorial showed you how to create a very simple pop-up div, but after a few requests in the comments, I felt it was important to update the technique so that multiple pop-up divs could be created without duplicating the code unnecessarily.</p>
<p>If you haven&#8217;t already read the first tutorial and are new to jQuery, it might be worth reading it to get a better understanding of the basic techniques before trying this slightly more advanced method.</p>
<h2>The Technique</h2>
<p>In this tutorial we are going to create a simple profile overview page containing 4 profile images and names. When we hover over the image or name a more detailed profile will appear. This div is positioned <strong>before</strong> the image and name link in the code and is initially hidden. When we hover over the image, a jQuery event will occur which will change the display declaration from hidden to block, making the div appear. This is when we make use of the <strong>prev()</strong> method.</p>
<h2>Tutorial Demo</h2>
<p>Still not sure what we are trying to achieve? Check out the tutorial demo below:</p>
<p><a title="Create Multiple Pop-up Divs using prev() method" href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div-02/"><img class="alignnone size-full wp-image-243" title="Create Multiple Pop-up Divs using prev() method" src="http://creativeindividual.co.uk/wp-content/uploads/2011/08/preview.jpg" alt="" width="648" height="407" /></a></p>
<div class="view-tutorial-demo"><a title="Create Multiple Pop-up Divs using prev() method" href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div-02/">View the Tutorial Demo</a></div>
<h2>The HTML</h2>
<p>Create a new HTML document and insert all the usual code – doctype, html tags, head tags, body tags, etc. as shown below:</p>
<pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;jQuery Tutorial - Pop-up div on hover - Version 2&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
<p>With that done, let&#8217;s insert our mark-up. First we&#8217;ll create a <strong>div</strong> with an id of container to act as our content wrap (to center it on screen and give it a nice width). Then I&#8217;ve inserted some basic information for the viewer in the form of a <strong>h1</strong> and <strong>p</strong>. Very simple so far!</p>
<p>Then we get to the important bit. Create a <strong>div with a class of profile</strong>. It&#8217;s important to use a class because we are going to have more than one of these on screen and of course we want our code to validate. Inside this div create another <strong>div with a class of pop-up</strong>. Insert whatever kind of information you need here but for the purposes of this example, I&#8217;m going to use basic profile information &#8211; Name, Age, and Location.</p>
<p>Again inside our <span style="color: #000000;"><strong>div with a class of profile</strong> but below the <strong>div with a class of pop-up</strong>, add the trigger link. Inside my <strong>link with a class of trigger</strong> I&#8217;ve added an image and a span with the profile name.</span></p>
<pre>...
&lt;div id="container"&gt;
  &lt;h1&gt;jQuery Tutorial - Pop-up div on hover&lt;/h1&gt;
  &lt;p&gt;
    To view profile information for each person, simply hover your
    mouse cursor over the profile image or name.
  &lt;/p&gt;

  &lt;div class="profile"&gt;
    &lt;!-- Hidden on load by CSS --&gt;
    &lt;div class="pop-up"&gt;
      &lt;p&gt;
        &lt;strong&gt;Name:&lt;/strong&gt; Person 1&lt;br /&gt;
        &lt;strong&gt;Age:&lt;/strong&gt; 23&lt;br /&gt;
        &lt;strong&gt;Location:&lt;/strong&gt; Canada
      &lt;/p&gt;
    &lt;/div&gt;
    &lt;!-- Show the hidden div on hover --&gt;
    &lt;a href="#" title="Person 1" class="trigger"&gt;
      &lt;img src="blank-avatar.gif" alt="Profile Image" /&gt;
      &lt;br /&gt;
      &lt;span class="name"&gt;Person 1&lt;/span&gt;
    &lt;/a&gt;
  &lt;/div&gt;
&lt;/div&gt;
...</pre>
<p>You then of course repeat the <strong>div with a class of profile</strong> however many times you need, but the basic structure remains the same.</p>
<p>Next we&#8217;ll need to create a div to clear the floats we will be adding to the profile divs in our css. I tend to always use a <strong>class of clear</strong> for this purpose. However you could add this style to almost anything, such as a <strong>footer</strong> or <strong>section</strong>.</p>
<pre>...
      &lt;!-- A clear div to sort out our floats --&gt;
      &lt;div class="clear"&gt;
        &lt;p&gt;
          This techique makes use of the &lt;strong&gt;prev()&lt;/strong&gt;
          method.
        &lt;/p&gt;
      &lt;/div&gt;

    &lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
<p>There&#8217;s one last thing we need to do before we are finished with our HTML. Let&#8217;s link to our stylesheet which we will be creating in the next step.</p>
<pre>...
&lt;head&gt;
  &lt;meta charset="utf-8" /&gt;
  &lt;title&gt;jQuery Tutorial - Pop-up div on hover - Version 2&lt;/title&gt;
  &lt;link rel="stylesheet" href="styles.css" type="text/css"
  media="screen" /&gt;
&lt;/head&gt;
...</pre>
<h2>The CSS</h2>
<p>Now its time to make things look a bit prettier. Create a new document and name it <strong>styles.css</strong>, i.e. the file name we have just linked to in our HTML.</p>
<p>First let&#8217;s quickly sort out our basic styles and wrapper div:</p>
<pre>body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #000 url(bg-texture.png) repeat;
  color: #dddddd;
}

h1, h3 {
  margin: 0;
  padding: 0;
  font-weight: normal;
}

a {
  color: #EB067B;
  text-decoration: none;
}

div#container {
  width: 580px;
  margin: 100px auto 0 auto;
  padding: 20px;
  background: #000;
  border: 1px solid #1a1a1a;
}</pre>
<p>All pretty basic stuff. Next we&#8217;ll style the profiles by floating them left and adding a width, plus giving our span a little bit of styling to make it sit nice.</p>
<pre>div.profile {
  width: 70px;
  text-align: center;
  float: left;
  margin: 10px 37px 30px 38px;
}

span.name {
  display: block;
  padding-top: 5px;
}</pre>
<p>Now the important bit, the pop-up div itself. We are going to use <span style="color: #000000;"><strong>position: absolute</strong> and <strong>display:none</strong>, plus a bit of styling to make it look good.</span></p>
<pre>/* HOVER STYLES */
div.pop-up {
  display: none;
  text-align: left;
  position: absolute;
  margin-top: -100px;
  width: 120px;
  padding: 0px 13px;
  background: #eeeeee;
  color: #000000;
  border: 1px solid #1a1a1a;
  font-size: 90%;
}</pre>
<p>And don&#8217;t forget our clearing div to sort our our floats on the profile divs.</p>
<pre>div.clear {
  clear: both;
}</pre>
<p>That&#8217;s the CSS done! Easy.</p>
<h2>The jQuery</h2>
<p>Now for what you&#8217;ve all be waiting for, the jQuery! Head back over to your HTML file. First we need to link to the jQuery library. I pretty much always link to Google&#8217;s files rather than download my own copy. The main reason for this is that it tends to speed things up a touch with user experience. Insert the following into the <strong>head</strong> of your HTML file.</p>
<pre>...
&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"&gt;&lt;/script&gt;
...</pre>
<p>Next we are going to create our pop-up effect. You can create your jQuery code in an external javascript file, such as <strong>popUp.js</strong> and linking to it just like we did above for the jQuery library. And in fact if you&#8217;re using a lot of javascript/jQuery I&#8217;d recommend it to keep things clean and legible. However for this example I&#8217;m going to write my code directly into the <strong>head</strong> of my HTML, below the line where I have link to Google&#8217;s jQuery library.</p>
<p><strong>Note:</strong> If your writing into the HTML head, you&#8217;ll need to wrap your jQuery with script tags:</p>
<pre>&lt;script type="text/javascript"&gt;
...
&lt;/script&gt;</pre>
<p>First let&#8217;s make our document ready. Below I&#8217;m using the long version for legibiliy but feel free to use the short version &#8211; <strong>$(function() { &#8230; });</strong></p>
<pre>$(document).ready(function() {
...
});</pre>
<p>If the javascript is running, i.e. the user doesn&#8217;t have javascript disabled or isn&#8217;t using a device that doesn&#8217;t support it, we can then use jQuery to change some CSS on our pop-up divs. First we&#8217;ll change the display declaration to <strong>display:block</strong>, then we&#8217;ll set an opacity declaration of <strong>opacity: 0</strong>:</p>
<pre>$(document).ready(function() {
  //If Javascript is running, change css on product-description to display:block
  //then hide the div, ready to animate
  $("div.pop-up").css({'display':'block','opacity':'0'})
});</pre>
<p>Next we are going to make use of the <strong>.hover()</strong> function, so that when someone hovers over our trigger, the image and span which are contained within the trigger link, something happens:</p>
<pre>...
$("a.trigger").hover()
...</pre>
<p>Inside this hover method we are going to create a function which will animate our pop-up divs, causing them to fade in. We&#8217;ll will use the <strong>this</strong> selector to select the current element and the <strong>.prev()</strong> method to select the previous element from the selector &#8211; in this case the current selector is <strong>a.trigger</strong> that we hovered over and the previous element is <strong>div.pop-up</strong> just before it in the code. We will then use <strong>.animate()</strong> to change the opacity from 0 to 1 and finally, set the animation speed. Sounds a lot but all this happens in only a few lines:</p>
<pre>...
$("a.trigger").hover(
  function () {
    $(this).prev().stop().animate({
      opacity: 1
    }, 500);
  }
)
...</pre>
<p>OK, so far so good. If you check your page in the browser you&#8217;ll see that our fade in effect is working perfectly. However, there is quite an obvious problem. The pop-up div doesn&#8217;t fade out again when we hover off. In fact it just hangs around there getting in the way! That&#8217;s because we haven&#8217;t told it to fade back out again when we hover off. Thankfully the .hover() function includes a <strong>callback</strong> which allows us to animate the hover off state. So let&#8217;s sort it out now.</p>
<p>We are going to do pretty much the same thing, only this time the opacity will change from 1 to 0 and we&#8217;ll speed up the animate a bit so that the pop-up fades out quicker than what it fades in:</p>
<pre>...
$("a.trigger").hover(
  function () {
    $(this).prev().stop().animate({
      opacity: 1
    }, 500);
  },
  function () {
    $(this).prev().stop().animate({
      opacity: 0
    }, 200);
  }
)
...</pre>
<p>Rechecking your page in the browser, you can now see that everything is going according to plan.</p>
<p><strong>That&#8217;s it!</strong></p>
<p><a title="Create Multiple Pop-up Divs using prev() method" href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div-02/"><img class="alignnone size-full wp-image-243" title="Create Multiple Pop-up Divs using prev() method" src="http://creativeindividual.co.uk/wp-content/uploads/2011/08/preview.jpg" alt="" width="648" height="407" /></a></p>
<div class="view-tutorial-demo"><a title="Create Multiple Pop-up Divs using prev() method" href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div-02/">View the Tutorial Demo</a></div>
<h2>Get The Source Code</h2>
<p>You can download the complete tutorial source code by clicking on the big button below and unzipping the file.</p>
<p><a href="/wp-content/uploads/2011/jquery-popup-div-02/jquery-popup-div-02.zip"><img class="alignnone size-full wp-image-108" title="Download Source File - jQuery Tutorial - Create Multiple Pop-up Divs using prev() method" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/download-source-file.png" alt="" width="648" height="104" /></a></p>
]]></content:encoded>
			<wfw:commentRss>https://creativeindividual.co.uk/2011/08/create-multiple-pop-up-divs-using-the-jquery-prev-method/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Create a Pop-up div in jQuery</title>
		<link>https://creativeindividual.co.uk/2011/02/create-a-pop-up-div-in-jquery/</link>
		<comments>https://creativeindividual.co.uk/2011/02/create-a-pop-up-div-in-jquery/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 22:57:17 +0000</pubDate>
		<dc:creator>Laura Montgomery</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://creativeindividual.co.uk/?p=190</guid>
		<description><![CDATA[<a href="/2011/02/create-a-pop-up-div-in-jquery" title="Create a Pop-up div in jQuery"><img src="/wp-content/uploads/2011/02/banner.png" /></a>

This is an easy tutorial suitable for those fairly new to jQuery. This tutorial will teach you how to create a simple pop-up effect, showing a hidden div, when you hover over the trigger link.

Included in the tutorial is a demo so that you can preview the script you will be learning to write, plus the source code for you to download and keep for future reference.

<div class="view-tutorial-demo"><strong>Update (13th August 2011):</strong> This technique has been updated to create the same effect with multiple pop-ups. View the new technique here:
<a title="Create Multiple Pop-up Divs using the jQuery prev() Method" href="/2011/08/create-multiple-pop-up-divs-using-the-jquery-prev-method/">Create Multiple Pop-up Divs using the jQuery prev() Method</a></div>]]></description>
			<content:encoded><![CDATA[<div class="view-tutorial-demo"><strong>Update (13th August 2011):</strong> This technique has been updated to create the same effect with multiple pop-ups. View the new technique here:<br />
<a title="Create Multiple Pop-up Divs using the jQuery prev() Method" href="/2011/08/create-multiple-pop-up-divs-using-the-jquery-prev-method/">Create Multiple Pop-up Divs using the jQuery prev() Method</a></div>
<p><a title="jQuery" href="http://jquery.com/">jQuery</a> is a powerful and easy-to-use Javascript library, like <a title="MooTools" href="http://mootools.net/">MooTools</a> and and <a title="Prototype" href="http://www.prototypejs.org/">Prototype</a>. It is not surprising that in recent years it has become extremely popular with website designers and has become the Javascript library of choice &#8211; <strong>I know it&#8217;s my favourite!</strong></p>
<p>If you are new to jQuery, you should check out my <a title="A Beginner's Guide to jQuery" href="http://creativeindividual.co.uk/2010/10/a-beginners-guide-to-jquery/">Beginner&#8217;s Guide to jQuery</a> article first, just to get to grips with the basics.</p>
<h2>Tutorial Demo</h2>
<p>This is an easy tutorial suitable for those fairly new to jQuery. This tutorial will teach you how to create a simple pop-up effect, showing a hidden div, when you hover over the trigger link.</p>
<p><a href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div/"><img class="alignnone size-full wp-image-191" title="Demo Preview" src="http://creativeindividual.co.uk/wp-content/uploads/2011/02/preview.png" alt="" width="648" height="407" /></a></p>
<div class="view-tutorial-demo"><a title="View the Tutorial Demo - jQuery Tutorial - Pop-up div on hover" href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div/">View the Tutorial Demo</a></div>
<h2>The HTML</h2>
<p>Create a new HTML document and insert all the usual code &#8211; doctype, html tags, head tags, body tags, etc. as shown below:</p>
<pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;jQuery Tutorial - Pop-up div on hover&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre>
<p>Notice how I am using the HTML5 doctype &#8211; <strong>&lt;!DOCTYPE html&gt;</strong> &#8211; it is a good idea to get into the habit of using this.</p>
<p>First we are going to create a <strong>div with an id of container</strong> to hold our page content and centralise it, just to make things a bit prettier. Inside this div we will add a <strong>h1, p</strong> (paragraph), and <strong>a </strong>(link/hyperlink) <strong>with an id of trigger</strong>. All this of course goes inside the <strong>body</strong> tags.</p>
<pre>...
&lt;body&gt;
  &lt;div id="container"&gt;
    &lt;h1&gt;jQuery Tutorial - Pop-up div on hover&lt;/h1&gt;
    &lt;p&gt;
      To show hidden div, simply hover your mouse over
      &lt;a href="#" id="trigger"&gt;this link&lt;/a&gt;.
    &lt;/p&gt;
  &lt;/div&gt;
&lt;/body&gt;
...</pre>
<p>Almost done with the HTML, the last thing we need to create is the div which will be hidden on the page loading, and triggered to become visible with the mouse hovers over the <strong>a#trigger tag</strong>.</p>
<pre>...
&lt;body&gt;
  &lt;div id="container"&gt;
    &lt;h1&gt;jQuery Tutorial - Pop-up div on hover&lt;/h1&gt;
    &lt;p&gt;
      To show hidden div, simply hover your mouse over
      &lt;a href="#" id="trigger"&gt;this link&lt;/a&gt;.
    &lt;/p&gt;

    &lt;!-- HIDDEN / POP-UP DIV --&gt;
    &lt;div id="pop-up"&gt;
      &lt;h3&gt;Pop-up div Successfully Displayed&lt;/h3&gt;
      &lt;p&gt;
        This div only appears when the trigger link is hovered over.
        Otherwise it is hidden from view.
      &lt;/p&gt;
    &lt;/div&gt;

  &lt;/div&gt;
&lt;/body&gt;
...</pre>
<h2>The CSS</h2>
<p>Now that we have our basic code in place, let&#8217;s style things up and make our page look a bit prettier. It is also at this stage that we will hide the pop-up div, using the <strong>display: none;</strong> css declaration.</p>
<p>Firstly, lets set some basic page styles and centre the container div, though if you are using this code within a website project, you don&#8217;t need to worry about this step as you will have your own page styles already set-up.</p>
<pre>body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #000 url(bg-texture.png) repeat;
  color: #dddddd;
}

h1, h3 {
  margin: 0;
  padding: 0;
  font-weight: normal;
}

a {
  color: #EB067B;
}

div#container {
  width: 580px;
  margin: 100px auto 0 auto;
  padding: 20px;
  background: #000;
  border: 1px solid #1a1a1a;
}</pre>
<p>For the sake of speed, I have added my styles inside the <strong>head</strong> tags of my html document, but for a live project I would always recommend attaching your styles to an external css document using the <strong>link</strong> tag.</p>
<p>In the css code above I am mostly just tweaking default browser styling, such as text colour, background colour, font-family, padding and margin &#8211; all pretty basic stuff. The most important bit is to make sure your <strong>div#container</strong> has a width and that the horizontal margins are set to auto &#8211; this centres the div, but again, pretty basic stuff.</p>
<p>Lastly, we are going to style the pop-up <strong>div</strong>. This is were the <strong>display: none;</strong> css attribute previously mentioned comes into play. It hides the div when the page loads. We also need to use <strong>position: absolute;</strong> so that the div gets positioned correctly with the jQuery we will add next. Again, we will add some basic styling such as width, colour, and padding, just to finish things off.</p>
<pre>/* HOVER STYLES */
div#pop-up {
  display: none;
  position: absolute;
  width: 280px;
  padding: 10px;
  background: #eeeeee;
  color: #000000;
  border: 1px solid #1a1a1a;
  font-size: 90%;
}</pre>
<h2>The jQuery</h2>
<p>Now we get to the exciting bit! Let&#8217;s add the jQuery to the page and get the pop-up div hover effect working. First we need to link to the jQuery library. You can download the latest files from <a title="jQuery.com" href="http://jquery.com/">jQuery.com</a> and link to them locally, but I prefer to link to Google&#8217;s library files for my own ease and for speed on the part of any visitors to your site. Insert the following line of code inside the <strong>head</strong> tags of your html document:</p>
<pre>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"&gt;&lt;/script&gt;</pre>
<p>Note that it is always worth checking what the latest version is and developing with that. However, this script definitely works with jQuery version 1.5.0.</p>
<p>Now let&#8217;s write our basic function. Just like with the css, I would always recommend linking to an external Javascript document, but for the sake of speed I have added my code into the <strong>head</strong> of my html document.</p>
<p>First let&#8217;s create a function:</p>
<pre>$(function() {

});</pre>
<p>Inside this function we are going to tell the browser that when someone hovers over the <strong>a tag</strong> with an <strong>id of trigger</strong>, to show the <strong>div</strong> with an <strong>id of pop-up</strong>.</p>
<pre>$(function() {
  $('a#trigger').hover(function() {
    $('div#pop-up').show();
  });
});</pre>
<p>Testing your page at this stage, you should see the div appear when you hover over the trigger link. However the first issue we have is that it doesn&#8217;t disappear again when you hover off the link. Let&#8217;s fix that.</p>
<p>By default, the .hover() method has a hover off call back. Add the following code to deal with the hover off method:</p>
<pre>$(function() {
  $('a#trigger').hover(function() {
    $('div#pop-up').show();
  }, function() {
    $('div#pop-up').hide();
  });
});</pre>
<p>We now have the hover off method set to hide the <strong>div#pop-up</strong> &#8211; great! Now notice when you test this page that the pop-up div appears no where near our mouse pointer. On this small page that is not an issue, but on a longer, busy page this could be a real problem &#8211; besides, it looks untidy!</p>
<p>Let&#8217;s make the pop-up div appear at our mouse-pointer. First add an <strong>e</strong> inside the brackets at <strong>.hover(function() {</strong>, then add the <strong>.css</strong> method after <strong>.show()</strong> but <em>before</em> the semi-colon.</p>
<pre>$(function() {
  $('a#trigger').hover(function(e) {
    $('div#pop-up').show()
      .css('top', e.pageY)
      .css('left', e.pageX)
      .appendTo('body');
  }, function() {
    $('div#pop-up').hide();
  });
});</pre>
<p>If you test your script at this stage, you will probably see the div flash and flicker as it appears and disappears from view. This is happening because the div is appearing right beneath our mouse-pointer. We need to move the div away slightly to deal with this. First create two variables to hold our values:</p>
<pre>$(function() {
  var moveLeft = 20;
  var moveDown = 10;
  ...
});</pre>
<p>Then add these variables to the <strong>e.pageX</strong> and <strong>e.pageY</strong>:</p>
<pre>$(function() {
  var moveLeft = 20;
  var moveDown = 10;

  $('a#trigger').hover(function(e) {
    $('div#pop-up').show()
      .css('top', e.pageY + moveDown)
      .css('left', e.pageX + moveLeft)
      .appendTo('body');
  }, function() {
    $('div#pop-up').hide();
  });
});</pre>
<p>When you re-test your page this time, things should look and behave much better. The div should pop-up when hovering over the trigger link, appearing 20px to the left and 10px below your mouse pointer. And it should disappear again when you hover off the trigger link.</p>
<p>We are pretty much there &#8211; however the div is pretty static once it appears on screen. Let&#8217;s make it follow our mouse pointer and give our script the extra WOW factor!</p>
<p>We are going to use the <strong>.mousemove</strong> method on the <strong>a#trigger</strong> selector and tell the <strong>div#pop-up</strong> to follow our mouse pointer using the same <strong>.css</strong> methods as before:</p>
<pre>$(function() {
  var moveLeft = 20;
  var moveDown = 10;

  $('a#trigger').hover(function(e) {
    $('div#pop-up').show()
      .css('top', e.pageY + moveDown)
      .css('left', e.pageX + moveLeft)
      .appendTo('body');
  }, function() {
    $('div#pop-up').hide();
  });

  $('a#trigger').mousemove(function(e) {
    $("div#pop-up").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
  });

});</pre>
<p>At this stage you can remove the first set of <strong>.css()</strong> methods as they are no longer needed. However, to make the code easier to read, I have just commented out the 3 now unnecessarily lines and added the semi-colon in after <strong>.show()</strong>. The code below is the final jQuery script:</p>
<pre>$(function() {
  var moveLeft = 20;
  var moveDown = 10;

  $('a#trigger').hover(function(e) {
    $('div#pop-up').show();
      //.css('top', e.pageY + moveDown)
      //.css('left', e.pageX + moveLeft)
      //.appendTo('body');
  }, function() {
    $('div#pop-up').hide();
  });

  $('a#trigger').mousemove(function(e) {
    $("div#pop-up").css('top', e.pageY + moveDown).css('left', e.pageX + moveLeft);
  });

});</pre>
<p><a href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div/"><img class="alignnone size-full wp-image-191" title="Demo Preview" src="http://creativeindividual.co.uk/wp-content/uploads/2011/02/preview.png" alt="" width="648" height="407" /></a></p>
<div class="view-tutorial-demo"><a title="View the Tutorial Demo - jQuery Tutorial - Pop-up div on hover" href="http://creativeindividual.co.uk/wp-content/uploads/2011/jquery-popup-div/">View the Tutorial Demo</a></div>
<h2>Get The Source Code</h2>
<p>You can download the complete tutorial source code by clicking on the big button below and unzipping the file.</p>
<p><a href="/wp-content/uploads/2011/jquery-popup-div/jquery-popup-div.zip"><img class="alignnone size-full wp-image-108" title="Download Source File - jQuery Tutorial - Pop-up div on hover" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/download-source-file.png" alt="" width="648" height="104" /></a></p>
]]></content:encoded>
			<wfw:commentRss>https://creativeindividual.co.uk/2011/02/create-a-pop-up-div-in-jquery/feed/</wfw:commentRss>
		<slash:comments>95</slash:comments>
		</item>
		<item>
		<title>Christmas Collections #1 &#8211; Seasonal Illustration Tutorials</title>
		<link>https://creativeindividual.co.uk/2010/12/christmas-collections-1-seasonal-illustration-tutorials/</link>
		<comments>https://creativeindividual.co.uk/2010/12/christmas-collections-1-seasonal-illustration-tutorials/#comments</comments>
		<pubDate>Sat, 11 Dec 2010 16:41:28 +0000</pubDate>
		<dc:creator>Laura Montgomery</dc:creator>
				<category><![CDATA[Christmas]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://creativeindividual.co.uk/?p=137</guid>
		<description><![CDATA[<a href="/2010/12/christmas-collections-1-seasonal-illustration-tutorials" title="Christmas Collections #1 - Seasonal Illustration Tutorials"><img src="/wp-content/uploads/2010/12/christmas-collections-1.jpg" /></a>

New to Creative Individual for the festive season is our <strong>Christmas Collections</strong>. We have searched the web for the best of everything Christmas themed. We will be bringing you great collections of festive goodies, including:

<ul>
<li>Illustration Tutorials</li>
<li>Wordpress Themes</li>
<li>Christmas Icons</li>
<li>Desktop Wallpapers</li>
<li>Fantastic Freebies</li>
</ul>

The first part of our <strong>Christmas Collections</strong> is a showcase of fantastic, festive illustration tutorials collected from some of the internet's best web designers, illustrators and digital artists.

<em>Merry Christmas &#38; Happy New Year from Creative Individual - Enjoy!</em>]]></description>
			<content:encoded><![CDATA[<p>Welcome to the first issue of <strong>Christmas Collections</strong> from Creative Individual. The festive season is upon us and we at Creative Individual have searched the web for the best of everything Christmas themed that the internet has to offer.</p>
<p>There will be several Christmas Collections from Creative Individual to get you into the spirit of the season, which will include tutorials, WordPress themes, Christmas icons, desktop wallpapers, fantastic freebies, and much more besides.</p>
<p>With all the said, are you ready for your first Christmas present from Creative Individual? Today&#8217;s <strong>Christmas Collection</strong> is a showcase of fantastic, festive illustration tutorials collected from some of the internet&#8217;s best web designers, illustrators and digital artists. <em>Enjoy!</em></p>
<h2>Create a Cute Vector Reindeer Character in Illustrator</h2>
<p>This Illustrator tutorial written by Chris Spooner shows you how to create a high quality, and very cute, Rudolph of your very own. Chris always produces fantastic tutorials and his blog is second-to-none (in my opinion). So if you haven&#8217;t already, make sure you add him to your RSS Feed so that he can continue to wow you throughout the coming year!</p>
<p><a href="http://www.blog.spoongraphics.co.uk/tutorials/create-a-cute-vector-reindeer-character-in-illustrator"><img class="alignnone size-full wp-image-138" title="Create a Cute Vector Reindeer Character in Illustrator" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/create-a-cute-vector-reindeer-character-in-illustrator.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="Create a Cute Vector Reindeer Character in Illustrator" href="http://www.blog.spoongraphics.co.uk/tutorials/create-a-cute-vector-reindeer-character-in-illustrator">http://www.blog.spoongraphics.co.uk/tutorials/create-a-cute-vector-reindeer-character-in-illustrator</a></p>
<h2>Beautiful Fluffy Clouds in Photoshop &#8211; Christmas Tutorial</h2>
<p>Abduzeedo is another designer who continually blows my mind with his amazing illustration skills. And in this tutorial from him, Abduzeedo shows you how to create a beautiful illustration which could be used on Christmas cards, desktop wallpapers and much more besides.</p>
<p><a href="http://abduzeedo.com/beautiful-fluffy-clouds-photoshop-christmas-tutorial"><img class="alignnone size-full wp-image-139" title="Beautiful Fluffy Clouds in Photoshop" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/beautiful-fluffy-clouds-in-photoshop.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="Beautiful Fluffy Clouds in Photoshop" href="http://abduzeedo.com/beautiful-fluffy-clouds-photoshop-christmas-tutorial">http://abduzeedo.com/beautiful-fluffy-clouds-photoshop-christmas-tutorial</a></p>
<h2>Create a Vector Clip-Art Style Snowman in Illustrator</h2>
<p>A simple and very easy-to-follow tutorial from Callum Chapman which shows you how to create a clip-art style snowman &#8211; this tutorial uses Adobe Illustrator and is a great one for beginners.</p>
<p><a href="http://circleboxblog.com/2009/tutorials/create-a-vector-clip-art-style-snowman-in-illustrator/"><img class="alignnone size-full wp-image-141" title="Create a Vector Clip-Art Style Snowman in Illustrator" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/create-a-vector-clip-art-style-snowman-in-illustrator.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="Create a Vector Clip-Art Style Snowman in Illustrator" href="http://circleboxblog.com/2009/tutorials/create-a-vector-clip-art-style-snowman-in-illustrator/">http://circleboxblog.com/2009/tutorials/create-a-vector-clip-art-style-snowman-in-illustrator/</a></p>
<h2>Design a Simple Illustration for Christmas</h2>
<p>The first of a few from Adobe Tutorials that we will be recommending. In this tutorial you will use a lot of simple techniques to create a highly polished final illustration.</p>
<p><a href="http://www.adobetutorialz.com/articles/30970180/1/Design-a-simple-illustration-for-Christmas"><img class="alignnone size-full wp-image-142" title="Design a Simple Illustration for Christmas" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/design-a-simple-illustration-for-christmas.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="Design a Simple Illustration for Christmas" href="http://www.adobetutorialz.com/articles/30970180/1/Design-a-simple-illustration-for-Christmas">http://www.adobetutorialz.com/articles/30970180/1/Design-a-simple-illustration-for-Christmas</a></p>
<h2>How to Create Happy New Year 2011 Greetings Card in Photoshop CS5</h2>
<p>The second from Adobe Tutorials, this tutorial is aimed at Photoshop CS5 users &#8211; so a great way to brush-up on some new skills and techniques.</p>
<p><a href="http://www.adobetutorialz.com/articles/30970646/1/how-to-create-happy-new-year-2011-greeting-card-in-photoshop-cs5"><img class="alignnone size-full wp-image-143" title="How to create Happy New Year 2011 greeting card in Photoshop CS5" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/how-to-create-happy-new-year-2011-greeting-card-in-photoshop-cs5.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="How to create Happy New Year 2011 greeting card in Photoshop CS5" href="http://www.adobetutorialz.com/articles/30970646/1/how-to-create-happy-new-year-2011-greeting-card-in-photoshop-cs5">http://www.adobetutorialz.com/articles/30970646/1/how-to-create-happy-new-year-2011-greeting-card-in-photoshop-cs5</a></p>
<h2>How to Create Stylized Greetings Card with Christmas Baubles in Photoshop CS5</h2>
<p>Another Photoshop CS5 tutorial from Adobe Tutorials &#8211; in this one, you&#8217;ll be creating some very shiny Christmas baubles on a beautiful and stylish snowflake background.</p>
<p><a href="http://www.adobetutorialz.com/articles/30970628/1/how-to-create-stylized-greeting-card-with-christmas-baubles-in-photoshop-cs5"><img class="alignnone size-full wp-image-144" title="How to create stylized greeting card with Christmas baubles in Photoshop CS5" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/stylized-greeting-card-with-christmas-baubles-photoshop-cs5.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="How to create stylized greeting card with Christmas baubles in Photoshop CS5" href="http://www.adobetutorialz.com/articles/30970628/1/how-to-create-stylized-greeting-card-with-christmas-baubles-in-photoshop-cs5">http://www.adobetutorialz.com/articles/30970628/1/how-to-create-stylized-greeting-card-with-christmas-baubles-in-photoshop-cs5</a></p>
<h2>Beautiful Christmas Vision Tutorial And Wallpaper</h2>
<p>Another Photoshop tutorial, and this one by Dainis Graveris on 1st Web Designer shows you how to create a simple, but very beautiful, Winter wonderland scene.</p>
<p><a href="http://www.1stwebdesigner.com/tutorials/beautiful-christmas-vision-tutorial-and-wallpaper/"><img class="alignnone size-full wp-image-145" title="Beautiful Christmas Vision Tutorial And Wallpaper" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/beautiful-christmas-vision-tutorial-and-wallpaper.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="Beautiful Christmas Vision Tutorial And Wallpaper" href="http://www.1stwebdesigner.com/tutorials/beautiful-christmas-vision-tutorial-and-wallpaper/">http://www.1stwebdesigner.com/tutorials/beautiful-christmas-vision-tutorial-and-wallpaper/</a></p>
<h2>24 Free Christmas Photoshop Tutorials</h2>
<p>Our first website containing a collection of great Christmas themed Photoshop tutorials, including one from Fabiano Meneghetti, co-founder of ZEE and one of the writers from Abduzeedo.</p>
<p><a href="http://www.toxel.com/design/2008/11/30/24-free-christmas-photoshop-tutorials/"><img class="alignnone size-full wp-image-146" title="24 Free Christmas Photoshop Tutorials" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/24-free-christmas-photoshop-tutorials.jpg" alt="" width="648" height="583" /></a></p>
<p><a title="24 Free Christmas Photoshop Tutorials" href="http://www.toxel.com/design/2008/11/30/24-free-christmas-photoshop-tutorials/">http://www.toxel.com/design/2008/11/30/24-free-christmas-photoshop-tutorials/</a></p>
<h2>60 Beautiful Christmas Photoshop Tutorials</h2>
<p>You can always be guaranteed to find great posts on the Smashing Magazines website, and this post of 60 Beautiful Christmas Photoshop Tutorials is no exception.</p>
<p><a href="http://www.smashingmagazine.com/2008/12/16/beautiful-christmas-photoshop-tutorials/"><img class="alignnone size-full wp-image-147" title="60 Beautiful Christmas Photoshop Tutorials" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/60-beautiful-christmas-photoshop-tutorials.jpg" alt="" width="648" height="615" /></a></p>
<p><a title="60 Beautiful Christmas Photoshop Tutorials" href="http://www.smashingmagazine.com/2008/12/16/beautiful-christmas-photoshop-tutorials/">http://www.smashingmagazine.com/2008/12/16/beautiful-christmas-photoshop-tutorials/</a></p>
<h2>20 Fantastically Festive Christmas Photoshop Tutorials</h2>
<p>The last of our websites containing a collection of Christmas themed tutorials. And this one from PSD Fan contains some very unusual and unique tutorials, so definitely worth checking out!</p>
<p><a href="http://psdfan.com/inspiration/graphic-design/20-fantastically-festive-christmas-photoshop-tutorials/"><img class="alignnone size-full wp-image-148" title="20 Fantastically Festive Christmas Photoshop Tutorials" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/20-fantastically-festive-christmas-photoshop-tutorials.jpg" alt="" width="648" height="615" /></a></p>
<p><a title="20 Fantastically Festive Christmas Photoshop Tutorials" href="http://psdfan.com/inspiration/graphic-design/20-fantastically-festive-christmas-photoshop-tutorials/">http://psdfan.com/inspiration/graphic-design/20-fantastically-festive-christmas-photoshop-tutorials/</a></p>
<h2>Design Christmas Card with Tree Balls in Photoshop</h2>
<p>In this tutorial from Adobe Tutorials, you will be shown how to create realistic looking baubles for a Christmas Card design.</p>
<p><a href="http://www.adobetutorialz.com/articles/30970109/1/design-christmas-card-with-tree-balls-in-photoshop"><img class="alignnone size-full wp-image-149" title="Design Christmas card with tree balls in Photoshop" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/design-christmas-card-with-tree-balls-in-photoshop.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="Design Christmas card with tree balls in Photoshop" href="http://www.adobetutorialz.com/articles/30970109/1/design-christmas-card-with-tree-balls-in-photoshop">http://www.adobetutorialz.com/articles/30970109/1/design-christmas-card-with-tree-balls-in-photoshop</a></p>
<h2>Create a Christmas Card – Christmas Tree on Red Background</h2>
<p>Another simple and stylish tutorial from Adobe Tutorials. Create a Christmas Tree on a red and black background, which includes a slight bokeh effect.</p>
<p><a href="http://www.adobetutorialz.com/articles/30970594/1/create-a-christmas-card-christmas-tree-on-red-background"><img class="alignnone size-full wp-image-150" title="Create a Christmas Card – Christmas Tree on Red Background" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/create-a-christmas-card-christmas-tree-on-red-background.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="Create a Christmas Card – Christmas Tree on Red Background" href="http://www.adobetutorialz.com/articles/30970594/1/create-a-christmas-card-christmas-tree-on-red-background">http://www.adobetutorialz.com/articles/30970594/1/create-a-christmas-card-christmas-tree-on-red-background</a></p>
<h2>How to Create a Christmas Greetings Card with New Year’s Toys in Photoshop CS5</h2>
<p>Our second last tutorial from Adobe Tutorials shows you how to make some stylised, glass/transparent Christmas baubles in Photoshop CS5.</p>
<p><a href="http://www.adobetutorialz.com/articles/30970626/1/how-to-create-christmas-greeting-card-with-new-year-s-toys-photoshop-cs5"><img class="alignnone size-full wp-image-151" title="How to Create Christmas a Greeting Card with New Year's Toys in Photoshop CS5" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/how-to-create-christmas-greeting-card-with-new-year-s-toys-photoshop-cs5.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="How to Create a Christmas Greetings Card with New Year's toys Photoshop CS5" href="http://www.adobetutorialz.com/articles/30970626/1/how-to-create-christmas-greeting-card-with-new-year-s-toys-photoshop-cs5">http://www.adobetutorialz.com/articles/30970626/1/how-to-create-christmas-greeting-card-with-new-year-s-toys-photoshop-cs5</a></p>
<h2>How to Create a Christmas Background with Snowflakes and Stars in Photoshop CS5</h2>
<p>Our last tutorial link for this post is our final from Adobe Tutorials. In this post you&#8217;ll create a stylish Christmas background illustration containing stars and snowflakes.</p>
<p><a href="http://www.adobetutorialz.com/articles/30970596/1/how-to-create-christmas-background-with-snowflakes-and-stars-in-photoshop-cs5"><img class="alignnone size-full wp-image-153" title="How to Create a Christmas Background with Snowflakes and Stars in Photoshop CS5" src="http://creativeindividual.co.uk/wp-content/uploads/2010/12/create-christmas-background-with-snowflakes-and-stars-in-photoshop-cs5.jpg" alt="" width="648" height="407" /></a></p>
<p><a title="How to Create a Christmas Background with Snowflakes and Stars in Photoshop CS5" href="http://www.adobetutorialz.com/articles/30970596/1/how-to-create-christmas-background-with-snowflakes-and-stars-in-photoshop-cs5">http://www.adobetutorialz.com/articles/30970596/1/how-to-create-christmas-background-with-snowflakes-and-stars-in-photoshop-cs5</a></p>
<h2>Christmas Collections #2</h2>
<p>Our next <strong>Christmas Collections</strong> post will contain some great links to Festive wallpapers and Christmas icons, so make sure you come back for more from Creative Individual.</p>
<p>Until part 2, enjoy the festive season and best wishes from Creative Individual.</p>
]]></content:encoded>
			<wfw:commentRss>https://creativeindividual.co.uk/2010/12/christmas-collections-1-seasonal-illustration-tutorials/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Make a Print-Ready, 1 Colour Business Card in Adobe Illustrator</title>
		<link>https://creativeindividual.co.uk/2010/11/make-a-print-ready-1-colour-business-card-in-adobe-illustrator/</link>
		<comments>https://creativeindividual.co.uk/2010/11/make-a-print-ready-1-colour-business-card-in-adobe-illustrator/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 20:56:12 +0000</pubDate>
		<dc:creator>Laura Montgomery</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://creativeindividual.co.uk/?p=89</guid>
		<description><![CDATA[<a href="/2010/11/make-a-print-ready-1-colour-business-card-in-adobe-illustrator" title="Make a Print-Ready, 1 Colour Business Card in Adobe Illustrator"><img src="/wp-content/uploads/2010/11/business-card-banner.jpg" /></a>

Create a stylish one colour business card using Adobe Illustrator. This step-by-step tutorial shows you how to create a professional looking business card using just a few simple tools in Illustrator. It also explains some of the technical terminology such as bleed and quiet zone.

In this tutorial you will create a stylised business card using only Magenta ink (you could also use just Cyan, Yellow or Black) and then prepare the file for print, ready to send to a professional printers. Also included are the source files for you to use.]]></description>
			<content:encoded><![CDATA[<p>I find that Adobe Illustrator can be a very flexible tool for creating print-ready artwork, especially for page layout where you don&#8217;t need any more than a couple of pages. This tutorial will show you how to create a stylish business card which is ready for professional printing, using just a few simple tools in Illustrator.</p>
<p><img class="alignnone size-full wp-image-104" title="Finished Business Card Design" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/business-card-final.jpg" alt="" width="648" height="400" /></p>
<p>In this tutorial we are going to create a <strong>1 process colour business card</strong>, namely magenta, which has a <strong>3mm bleed</strong> and a <strong>5mm quiet zone</strong>. Don&#8217;t worry if you don&#8217;t know what this all means, things will become apparent as we go through the tutorial. My business card&#8217;s final size is <strong>85 x 55mm</strong> (width x height) but you should check with your local printer what size they prefer before creating your artwork.</p>
<h2>Let&#8217;s Get Started</h2>
<p><img class="alignnone size-full wp-image-90" title="File set-up" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/01.jpg" alt="" width="648" height="374" /></p>
<p>First open up Adobe Illustrator and create a new document that is 85 x  55mm (or whatever size your printer recommends). Make sure to set the  <strong>Color Mode to CMYK</strong> (for printing) as opposed to RGB (for screen).</p>
<p><img class="alignnone size-full wp-image-91" title="Setting up guides" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/02.jpg" alt="" width="648" height="399" /></p>
<p>Once you have your new document, I recommend setting up some guides as a visual reference to let you know if you&#8217;ve going off-track. If they are not already visible, press CMD/Ctrl + R to show the page rulers.</p>
<p>First set up the bleed &#8211; the bleed essentially means you&#8217;ll make an image larger than your final artwork so that you can have colour right to the edges. It means that when the printer trims the paper, there is no chance of accidentally getting an unsightly white edge!</p>
<p>My printer recommends <strong>3mm bleed</strong>, again you should check what your printer prefers. My guides need to be set 3mm outside the artwork box. The left guide is positioned -3mm on the x co-ordinates while the right is 88mm, the top guide is 58mm on the y co-ordinates while the bottom is -3mm.</p>
<p>The quiet zone again saves us from potential errors caused by any shift in the trimming process and also keeps our artwork looking tidy by not having text run all the way to the edge. I&#8217;m setting my <strong>quiet zone to 5mm</strong>. So the left guide will be at 5mm on the x co-ordinates while right is 80mm, the top guide is at 50mm on the y co-ordinates while the bottom is at 5mm.</p>
<p><img class="alignnone size-full wp-image-92" title="Text Tool" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/03.jpg" alt="" width="648" height="445" /></p>
<p>Once you&#8217;re all set up, it&#8217;s time to get started and create the artwork. Grab the <strong>Type Tool </strong>(or T on your keyboard)<strong> </strong>and create a text box. Type your name or business name and select a strong typeface &#8211; I&#8217;ve opted for Century Gothic in bold.</p>
<p><img class="alignnone size-full wp-image-106" title="Locating the Star Tool" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/star-tool.jpg" alt="" width="648" height="416" /></p>
<p>Next we are going to add a star shape using the <strong>Star Tool</strong>. If you&#8217;ve never used it before, you&#8217;ll find it amongst the shape tools, most-likely fronted by the Rectangle Tool as shown above.</p>
<p>Just like the Rectangle Tool, if you click once on screen with this tool selected, you can enter in exact co-ordinates to help you create the perfect star for your artwork.</p>
<p><img class="alignnone size-full wp-image-93" title="Insert the star using the Star Tool" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/04.jpg" alt="" width="648" height="290" /></p>
<p>Create the star and position it beside your name. You may need to experiment with the size a bit to get the effect you are completely happy with. I recommend holding <strong>Shift</strong> while you scale the star up and down using the <strong>Selection Tool </strong>(or V on the keyboard) to keep it&#8217;s proportions correct. I&#8217;ve also rotated my star slightly to add some character.</p>
<p><img class="alignnone size-full wp-image-94" title="Create a Magent band of colour using the Rectangle Tool" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/05.jpg" alt="" width="648" height="448" /></p>
<p>Next we are going to create a magenta band of colour by using the <strong>Rectangle Tool</strong> (or press M on your keyboard). Like with the Star Tool, simply click once on screen to enter in the exact co-ordinates. I&#8217;ve created mine at <strong>91 x 10mm</strong> &#8211; this means it runs from bleed guide to bleed guide and is 1cm tall. I&#8217;ve also positioned it just on the edge of my quiet zone, meaning when trimmed, my card with have a 5mm white band at the top. Make sure the colours in the colour pallette are set to <strong>0, 100, 0, 0 for 100% Magenta</strong>.</p>
<p><img class="alignnone size-full wp-image-95" title="Positon your logo within the band of colour" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/06.jpg" alt="" width="648" height="443" /></p>
<p>Next select both the text and star and group them (CMD/Ctrl + G) and then position your logo inside the magenta band of colour. You will need to bring the logo to the front by pressing Shift + CMD/Ctrl + ] on your keyboard otherwise it will be hidden beneath the band of colour. Don&#8217;t forget to change the text to white, otherwise we are no longer preparing artwork for 1 colour-process printing.</p>
<p>Again, keep the logo outside the quiet zone. You may also wish to scale the logo up or down &#8211; don&#8217;t forget to hold Shift while using the Selection Tool (V) to keep the proportions.</p>
<p><img class="alignnone size-full wp-image-96" title="Insert your details" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/07.jpg" alt="" width="648" height="442" /></p>
<p>Create another text box using the Type Tool and enter in your details. I&#8217;ve decided to create one box with type in bold for my occupation, and another in regular for my contact details (p.s. that&#8217;s not my real telephone number). I recommend keeping all your text boxes aligned to one another to keep everything looking professional, so on this case I&#8217;ll position all my text boxes and logo to the left edge of the quiet zone.</p>
<p>We have now finished the artwork for the front of the card. Save your artwork as &#8216;business-card-front&#8217;, then duplicate the file, renaming it as &#8216;business-card-back&#8217;. We now have the back of the business card already set up with guides and logo ready to use.</p>
<p><img class="alignnone size-full wp-image-97" title="Delete contact details and expand the background colour" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/08.jpg" alt="" width="648" height="467" /></p>
<p>Open your new file &#8216;business-card-back.ai&#8217; and delete the contact details. Resize your band of magenta to <strong>91 x 61mm</strong> and make sure it lines up with the bleed guides on all sides.</p>
<p><img class="alignnone size-full wp-image-98" title="Create a background graphic and re-position the logo" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/09.jpg" alt="" width="648" height="424" /></p>
<p>Grab your Star Tool again and create an oversized star graphic. Change the star graphic colour to <strong>75% Magenta</strong>, i.e. the CMYK colours in the colour-palette will read 0, 75, 0, 0. Position this graphic so that it flows over the boundaries of the canvas. Don&#8217;t worry, we sort out the over-spill in a minute! You will also need to Send Backward the graphic one layer (CMD/Ctrl + [) so that it is positioned above the background colour but below the logo.</p>
<p>Also, re-position your logo to the centre or wherever you feel looks best.</p>
<p><img class="alignnone size-full wp-image-99" title="Creating a Clipping Mask" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/10.jpg" alt="" width="648" height="485" /></p>
<p>Now we are going to create a <strong>Clipping Mask</strong> to deal with our star graphic over-spill. Select the background box and copy it (CMD/Ctrl + C), then paste it in front (CMD/Ctrl + F). Still selected, bring the copied box to the front (Shift + CMD/Ctrl + ]). Select all (CMD/Ctrl + A) and then right-click and select &#8216;<strong>Make Clipping Mask</strong>&#8216; as shown above.</p>
<p><img class="alignnone size-full wp-image-100" title="Clipping Mask in place" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/11.jpg" alt="" width="648" height="465" /></p>
<p>We now have our Clipping Mask in place and have completed the artwork for the back of the business card. Save your file (CMD/Ctrl + S).</p>
<p><img class="alignnone size-full wp-image-101" title="Saving the PDF - making ready for print" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/12.jpg" alt="" width="648" height="527" /></p>
<p>We are nearly there! Now it is time to <strong>save our file as a PDF</strong> and make it <strong>ready for print</strong>! This time Save As (Shift + CMD/Ctrl + S) and change the file type to PDF. Then make sure you are saving as a high resolution PDF (with no compression) and that you have the above <strong>Marks &amp; Bleeds</strong> set.</p>
<p>Selected are the Trim Marks and Registration Marks, with the Trim Weight set to 0.25pt and the Offset to 3mm. The Bleeds are all set to 3mm.</p>
<p>Open up the &#8216;business-card-front.ai&#8217; file and repeat the previous step, saving the file as a PDF ready for print.</p>
<p>Lastly, open up your PDF files and double-check you are happy with everything before sending your final artwork to print. Always worth double-checking are things like your contact details, telephone number and if you&#8217;ve spelt your own name correctly!</p>
<p><img class="alignnone size-full wp-image-105" title="Business Card Front - In PDF with registration and trim marks" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/front.jpg" alt="" width="648" height="471" /></p>
<p><img class="alignnone size-full wp-image-102" title="Business Card Back - In PDF with registration and trim marks" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/back.jpg" alt="" width="648" height="471" /></p>
<p>That&#8217;s it! You&#8217;ve now created artwork for your own business card which you can send to any professional printers. This example uses only magenta ink, however for one colour processing you could also use <strong>cyan, yellow</strong> or <strong>black</strong> to create a similar effect.</p>
<p><a href="http://creativeindividual.co.uk/wp-content/uploads/2010/11/one-colour-business-card.zip"><img class="alignnone size-full wp-image-108" title="Download Source File" src="http://creativeindividual.co.uk/wp-content/uploads/2010/11/download-source-file.png" alt="" width="648" height="104" /></a></p>
<h2>Further Reading &amp; Inspiration</h2>
<p>You can apply the techniques used in this tutorial to create your own designs. Use the links below to get some inspiration and see some fantastic examples of business card design:</p>
<ul>
<li><a title="Showcard of business cards with patterns - Design Juices" href="http://www.designjuices.co.uk/2010/11/showcase-business-cards-patterns/">http://www.designjuices.co.uk/2010/11/showcase-business-cards-patterns/</a></li>
<li><a title="Cool business card designs - Creative Bits" href="http://creativebits.org/cool_business_card_designs">http://creativebits.org/cool_business_card_designs</a></li>
<li><a title="Smokin hot business card designs - Freelance Switch" href="http://freelanceswitch.com/general/18-smokin-hot-business-card-designs/">http://freelanceswitch.com/general/18-smokin-hot-business-card-designs/</a></li>
<li><a title="100 really creative business cards - Web Designer Depot" href="http://www.webdesignerdepot.com/2009/05/100-really-creative-business-cards/">http://www.webdesignerdepot.com/2009/05/100-really-creative-business-cards/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://creativeindividual.co.uk/2010/11/make-a-print-ready-1-colour-business-card-in-adobe-illustrator/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
