<?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>Electric Fairground &#187; jquery</title>
	<atom:link href="http://www.electricfairground.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.electricfairground.com</link>
	<description>OOOm pa pa, OOOm pa pa . . .</description>
	<lastBuildDate>Fri, 23 Jul 2010 11:38:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Restoring conventional page navigation to your javascript application with jQuery history plugin</title>
		<link>http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/</link>
		<comments>http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 19:56:03 +0000</pubDate>
		<dc:creator>Lappa</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.electricfairground.com/?p=61</guid>
		<description><![CDATA[I&#8217;m not sure how, but my jQuery application suddenly got very complicated. One minute I was adding cool onmouseover effects and then BANG I&#8217;m inserting new elements all over the place and I have to look into heavy compression just to get the thing to download this side of the apocalypse. Browsing through my application [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.electricfairground.com%2F2009%2F10%2F01%2Frestoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.electricfairground.com%2F2009%2F10%2F01%2Frestoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin%2F&amp;source=robinspots&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;m not sure how, but my jQuery application suddenly got very complicated. One minute I was adding cool onmouseover effects and then BANG I&#8217;m inserting new elements all over the place and I have to look into heavy compression just to get the thing to download this side of the apocalypse.</p>
<p>Browsing through my application is a breeze. All the links are rewired to AJAX requests with smooth transitions and lots of slideUp-and-downs. There&#8217;s one glaring hole that might just bring this happy user experience down quicker than a Lehman brother wearing Iron Boots.</p>
<p>Whenever my lovely users click &#8216;back&#8217; on their browser they get taken back to the obscenity that is the non-standards-compliant flashing gif-ridden site they came from, not the last thing they were viewing on my site. And if he or she clicks ‘refresh’ the application state goes back to the original and my user has to navigate back to the page he or she was viewing all over again. What a knightmare.</p>
<p>The browser navigation controls &#8211; back, forwards and refresh &#8211; are a staple of any user&#8217;s experience. Of course, being a web developer you will recognise the lack of page refreshes and the changing of page elements and automatically look for site-specific navigation links on the page itself. However, your average user is going to get very confused, thinking their browser buttons are broken or worse &#8211; your website is broken.</p>
<p>And it&#8217;s not only the user that&#8217;s going to encounter problems. If a Google Spider can’t see pages with unique URLs it’s not going to index them. So all I’m going to get on a Google search is whatever is on the landing page, which is just header information and a footer &#8211; not very useful. If my user wants to bookmark a page for later, he or she is going to have to start again, before all the AJAX fun began. The list goes on. It&#8217;s like building a vast palace with turrets and different wings but neglecting to build any doors. Your guests are going to walk over the drawbridge and marvel at the splendour of your architecture, the complete set of Power Ranger themed bedrooms, yet have no idea how to get there.</p>
<p>Anyway, here&#8217;s how I solved it:</p>
<p><span id="more-61"></span></p>
<h2>Step 1: jQuery history plugin</h2>
<p>First of all, I downloaded the <a href="http://www.mikage.to/jquery/jquery_history.html">Mikage’s jQuery history plugin</a>. This is a bit of code that allows me to write to my browser’s history using a hash key. This hash can be pretty much anything that can uniquely describe your application&#8217;s state. I chose to make it the same as the resource I was loading into the main part of my application. So the plugin would add &#8216;www.mysite.com/page1#page2&#8242; to my browser history when I clicked on the &#8216;Page 2&#8242; link. Once I’d saved the plugin to my computer, I put this line in my head section of page1.html.</p>
<pre class='brush: js'>

&lt;script src='http://www.mysite.com/js/jquery.history.js' type='text/javascript'&gt;&lt;/script&gt;
</pre>
<p>Now that jQuery knows I want to use this plugin, I need to initialise before I can start using it. I put this line just below the previous line, also in the $(document.ready()) section.</p>
<pre class='brush: js'>
$(document).ready(function() {

$.historyInit(ajaxRender, 'http://www.mysite.com/page1');
};
</pre>
<p>Right, now it’s ready to use.</p>
<h2>Step 2: The click event</h2>
<p>Thinking about it, the page state always changes directly after the user clicks on a link (as it would on any other site I guess). So each of these state changes is tied to an &lt;a&gt; element. Therefore, I’m going to use jQuery’s live() function to tie a function to each link element’s ‘click’ event. So every time a user clicks a link some code will get executed. I used the live() function instead of the more common click() event handler because live() ties all future instances of an element to the function instead of just the ones initially in the DOM. This means I can happily insert new &#8216;a&#8217; elements knowing that they’ll still respond in the same way. Here’s the click event code (this should also go in the $(document).ready so that it&#8217;s ready when the page loads):</p>
<pre class='brush: js'>

$('a.internal').live('click',function() {
var post_url = $(this).attr('href');
//alert(post_url);
$.historyLoad(post_url);
return false;
});
</pre>
<p>You can see that I&#8217;m binding this function to the click events for each &#8216;a.internal&#8217; element. I&#8217;ve given each internal link this class so that I can differentiate between internal and external links. If all links were treated the same, I&#8217;d get google.com loading inside my homepage. I extract the ‘href’ part of the link so that I know where the link is pointing. This is then assigned to the variable ‘post_url’. Then I call the historyLoad() method. This tells the jQuery plugin I just set up to add a new page to the browser history. It does this by adding a hash key to the end of the url. For example www.mysite.com/page1 would become www.mysite.com/page1#page2 in the address bar, and my application would then go about rendering the page2 on my page to reflect the change. The ‘return false;’ line is important, as this stops the browser executing it’s normal event handling for the element. If I didn’t include this line, all would be lost, as the browser would merrily redirect us to page2.html (thinking it was a regular link) and page1 would be lost to the wind.</p>
<h2>Step 3: Rendering the page</h2>
<p>Once historyLoad() has done it’s job and added a page to the browser history, it will then follow a callback function that we defined earlier with historyInit(). The callback function renderPage() is going to run the AJAX request and insert the new data into my page. The code for this is as follows (this can go anywhere in your javascript code):</p>
<pre class='brush: js'>

function ajaxRender(post_url) {
$('body').css('cursor','wait'); // changes the cursor to a wait symbol
if($.browser.msie) { // if the browser is Internet Explorer
// jquery's $.load() function does't work when hash include special characters like åäö.
post_url = encodeURIComponent(post_url); // removes special characters
}
if (post_url) { // checks that a URL is present
$.ajax({ // start the AJAX request
type: 'POST', // I'm sending it via POST, you can use GET if you're feeling dangerous
url: post_url, // the URL we are retrieving
data: null, // in this case we are not sending any data
success: function(data) { // execute the below if the AJAX goes according to plan
$('#page_content').html(data); // put the data retrieved from the AJAX request into the div container
$('body').css('cursor','default'); // put the cursor back to normal
},
error: function (XMLHttpRequest, textStatus, errorThrown) { // execute this if it all goes tits up
$('body').css('cursor','default');
alert(textStatus + errorThrown);
return false;
}
});
} else { // if there is no post_url, i.e. it's the home page
$('body').css('cursor','default'); // put the cursor back to normal
}
};
</pre>
<p>This function executes the AJAX request and puts the data it retrieves into the #page_content div.</p>
<p>Once you&#8217;ve got these three components in your code you should be OK.</p>
<p>Note: If you’re just loading stuff from a file and not sending data it would be a better idea to use jQuery’s load() method.</p>
<p>Feel free to comment if there&#8217;s a bit you don&#8217;t understand or are having trouble with.</p>
<p>Edit: I just discovered that this process is called &#8216;deep linking&#8217;. Sounds like a bit of a serious term, but it is much shorter than &#8216;the restoration of conventional page navigation to an AJAX application&#8217;. Had I known this before I wrote this post I probably would&#8217;ve looked into using the <a href="http://www.asual.com/jquery/address/">jQuery Address deep linking plugin</a> instead. But my method worked fine for me . . .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/10/01/restoring-conventional-page-navigation-to-your-javascript-application-with-jquery-history-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Image map rollover effects using jQuery&#8217;s MapHilight plugin</title>
		<link>http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/</link>
		<comments>http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 12:15:49 +0000</pubDate>
		<dc:creator>Lappa</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Inkscape]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[maphilight]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[polygon]]></category>
		<category><![CDATA[rollover]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.electricfairground.com/?p=47</guid>
		<description><![CDATA[<a href=http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/><img src=http://www.electricfairground.com/img/maphilight_post/grey_map.png class=imgtfe hspace=5 align=left width=100  border=0></a>Update: you can see the finished version of my map here. So I want to make a big map of europe that hilights the different countries when you move your mouse over them. Initially I thought this would be really easy using a bit of CSS and :hover . . . . no dice. But [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.electricfairground.com%2F2009%2F08%2F08%2Fimage-map-rollover-effects-using-jquerys-maphilight-plugin%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.electricfairground.com%2F2009%2F08%2F08%2Fimage-map-rollover-effects-using-jquerys-maphilight-plugin%2F&amp;source=robinspots&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><span style="color: #ff6600;">Update: you can see the finished version of my map <a href="http://www.workingineuropeandasia.com/?u=1c6a6f942368d690c3cba37b7b0eef6a">here</a>.</span></p>
<p>So I want to make a big map of europe that hilights the different countries when you move your mouse over them. Initially I thought this would be really easy using a bit of CSS and :hover . . . . no dice. But to my surprise I found out that it&#8217;s possible to use an ordinary HTML image map to define some pretty complex shapes, and let&#8217;s face it, shapes don&#8217;t get much more complex than this.</p>
<p>OK, so it&#8217;s possible to create clickable areas in HTML using an image map, but how do I add rollover effects to this? CSS didn&#8217;t seem to work so my next port of call was the wonderful jQuery. I found a plugin call <a href="http://plugins.jquery.com/project/maphilight">mapHilight</a> that takes an HTML image map, and adds some javascript hilighting wizardry to it. You can see a really cool example using a <a href="http://davidlynch.org/js/maphilight/docs/demo_usa.html">map of the states</a>, this is almost exactly what I want but for Europe. I&#8217;m going to try and record everything I do, in the hope that someone else might find this useful, so here goes.</p>
<p><span id="more-47"></span></p>
<h2>Step 1: Your image</h2>
<p>First of all, you need to prepare the source image. In this example I&#8217;m going to be using a map of europe (see below).</p>
<p><a href="http://www.electricfairground.com/img/maphilight_post/grey_map.png"><img class="alignnone" title="Grey map of Europe" src="http://www.electricfairground.com/img/maphilight_post/grey_map.png" alt="" width="340" height="351" /></a></p>
<h2>Step 2: HTML Image Maps</h2>
<p>Now that I have my image ready, I need to work out how to get the computer to recognise the individual areas. For my map each country is separated from other bordering countries by a white line, your image might not be so defined, in which case you should probably open the image up in Photoshop or something and separate the sections to make it easier.</p>
<p>I did a bit of research on Google and came across something quite interesting. Built into HTML there are &lt;map&gt; and &lt;shape&gt; tags. These are used to define image maps like the one I&#8217;m trying to make. An example of an HTML image map is this:</p>
<pre class="brush: js">
<map name="testMap">
<area id="box" shape="polygon" coords="20,20,106,20,106,106,20,106" href="http://www.stackoverflow.com" />
<area id="triangle" shape="polygon" coords="216,50,339,50,277,156" href="http://www.google.com" />
<area id="bordertriangle" shape="polygon" coords="460,0,574,0,460,220" href="http://www.cnn.com" />
<area id="pentagon" shape="polygon" coords="704,65,769,115,744,196,665,196,640,115" href="http://slashdot.org" />
</map>
</pre>
<p>Here you can see four areas within a map. In this example each area is set as shape=&#8217;polygon&#8217;. This is because these shapes are complex and can&#8217;t be defined in simpler terms. However, if your image map is not so complicated, you could try using shape=&#8217;rect&#8217; or shape=&#8217;circle&#8217;.</p>
<ul>
<li><a href="http://www.javascriptkit.com/howto/imagemap.shtml">More information on Creating HTML Image Maps</a></li>
</ul>
<p>OK, so I know that the shape of each country on my map can probably be defined as a list of points (like a join-the-dots puzzle). I&#8217;m not sure exactly what the numbers will mean, but I guess they&#8217;re just coordinates on a fictional grid slapped on top of my image.</p>
<p>Next question: How do I get these coordinates for my own image?</p>
<h2>Step 3: Download Inkscape</h2>
<p>Well after a bit more digging I found an App called <a href="http://www.inkscape.org/index.php?lang=en">Inkscape</a>.</p>
<p><a href="http://www.inkscape.org/download/?lang=en">Download Inkscape (free)</a></p>
<p>I think you can probably use some other apps too, like Illistrator or something else, but I don&#8217;t have the kind of money to splash out on such overpriced tripe, so I&#8217;ll be using Inkscape.</p>
<p>Right, while that&#8217;s downloading I&#8217;ll explain why I think Inkscape will do the job. To be honest I don&#8217;t really know that much about inkscape. What I do know is that you can open up any image you like and trace the edges. You can then save the image again (in a different format) and this will contain this list of coordinates that I&#8217;m after. Hopefully.</p>
<h2>Step 4: Path Detection in Inkscape</h2>
<p><code>Once you've finished downloading Inkscape you'll need to open it up. Then select File&gt;Open and select the image you are working on.</code></p>
<p>Now here&#8217;s where it gets a bit more complicated. Inkscape is very good at detecting edges, but I found it needed a helping hand to make sure it knew that all of these countries were separate blobs, and not just one big blob. The first time I tried edge detection I managed to get a big polygon, but it was so big that it took up most of mainland europe. What I&#8217;d recommend you do is do a bit of experimentation to see how well Inkscape finds the borders in your image.</p>
<p>To give it a go, click on your image (so that there are black resizing dots around it), then select Path&gt;Trace Bitmap. In the box that pops up, you can either select &#8216;Edge Detection&#8217; or &#8216;Color Quantization&#8217;. As far as I can tell, you should use the first if there are very definitive edges already in the image and the second if the areas you&#8217;re trying to separate are different colours. I first tried &#8216;Edge Detection&#8217; and this wasn&#8217;t really working for me. So I went back to Photoshop and coloured all my countries in different colours, opened Inkscape back up and selected &#8216;Color Quantization&#8217; and it worked much better. Once you&#8217;ve selected your choice click &#8216;Update&#8217; to get a preview of what it will look like and then &#8216;OK&#8217; to start the magic.</p>
<p>Now if it&#8217;s worked, you should see a black line around each of the areas in your image. Inkscape should turn your image into several different shapes all with a black outline. If this doesn&#8217;t happen, or you get shapes in the wrong places, you&#8217;ll have to undo the path detection and try again. Once you&#8217;re happy you can move onto the next step.</p>
<h2>Step 5: HTML Polygonization</h2>
<p>In Inkscape, save the image as a .svg file. This is the format we&#8217;re going to use to extract the path information for our HTML polygon shapes. Open up your SVG file in your favourite text editor and scroll down until you find a list of numbers a bit like this one:</p>
<p>d=&#8221;M 662.5,1204 C 634.39954,1200.1136 558.02119,1154.3401 .. . .. .</p>
<p>Believe it or not, this is your image map. Unfortunately this data is in a format that isn&#8217;t very useful to us. Not only are the shape coordinates shrouded in a mysterious M and C characters, but they are also using lots of decimal places which HTML can&#8217;t understand. To sort this jumble of nonsense I decided to write a bit of Javascript. I call this my <a href="http://www.electricfairground.com/polygonator/index.html">Polygonator</a>. Go there and enter in the numbers and text within the &#8220;s just after d=&#8221;. So your bit of text will start M 662 . . .etc and should end with a single z. Then click &#8216;Process&#8217; and you should be given some HTML code. Hooray!</p>
<p>A word of warning: depending on how acurate you want your area to be you may need to simplify your path a bit. If your SVG files contains millions of coordinates and you want something much simpler, then you can open it back up in Inkscape and select Path&gt;Simplify. Then repeat this step.</p>
<h2>Step 6: Add Your Image Area</h2>
<p>Copy all of this HTML and paste it between the &lt;map&gt; &lt;/map&gt; tags in your webpage. You should now have something that looks a bit like:</p>
<pre class="brush: html">
<map name="testMap">
<area id="shape1" shape="poly" coords="20,20,106,20,106,106,20,106" href="http://www.electricfairground.com" />
</map>
</pre>
<p>If you have more than one line in your SVG file starting with d=&#8221; then you&#8217;ll need to process each of these and convert them one at a time. Just repeat steps 5 and 6 for each of them and you should be OK.</p>
<h2>Step 7: jQuery and mapHilight</h2>
<p>Now we need to tie up the loose ends and get to the jQuery bit. If you haven&#8217;t already included jQuery at the top of your page then put this in your &lt;head&gt; section:</p>
<pre class="brush: php">
&lt; ?= javascript_include_tag('jquery-1.3.2.min.js'); ?&gt;</pre>
<p>Now we need to add the MapHilight jQuery plugin. I don&#8217;t really understand what this plugin does, but it seemed to do wonders for my map, so you should give it a go too.  Download the <a href="http://plugins.jquery.com/project/maphilight">mapHilight plugin</a> and then include it just after you included jQuery.</p>
<pre class="brush: php">
&lt; ?= javascript_include_tag('jquery.maphilight.min.js'); ?&gt;

<script type="text/javascript"><!--mce:0--></script></pre>
<p>The second bit of script just initiates the plugin. It looks for an image with class=&#8217;map&#8217;, so if you&#8217;re using the same code make sure your image has this class. For example:</p>
<pre class="brush: html">
<img usemap="#testMap" src="images/map/grey_map.png" alt="Click on a country to see its profile" /></pre>
<p>You&#8217;ll see my image also has usemap=&#8221;#testMap&#8221;. This is the bit that links the image to the &lt;map&gt;. So make sure you include the name of your map in this bit.</p>
<h2>Good Work Team</h2>
<p>Finished! Now when you look at your page you should see that different sections of your map light up when you move your mouse over them. Let me know if you have any problems and I&#8217;ll do my best to suggest something.</p>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">v</button><button id="LIU_2" style="border-bottom: 1px solid white; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: #dddddd;">m</button></div>
</form>
</div>
</div>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">v</button><button id="LIU_2" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">m</button></div>
</form>
</div>
</div>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">v</button><button id="LIU_2" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">m</button></div>
</form>
</div>
</div>
<div style="width: 460px; height: 100%; top: 0px; right: 0px; padding-left: 0px; position: fixed; background-color: white; z-index: 1000; display: none;">
<div style="border: 0px none; top: 1px; width: 100%; height: 42px; position: absolute;">
<form>
<div style="position: absolute; left: 2px; right: 0px;">
<input id="LIU_txt" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; left: 0px; right: 240px; font-size: 14px ! important; height: 17px ! important; line-height: 50px; display: block;" />
<select id="LIU_sel" style="border: 1px solid black; margin: 0pt; padding: 0pt; position: absolute; width: 100px; right: 138px; font-size: 14px ! important; height: 17px;">
<option style="border: 0pt none; width: 30%; height: 19px;">Wikipedia</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Wictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Chambers (UK)</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google images</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google define</option>
<option style="border: 0pt none; width: 30%; height: 19px;">The Free Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Join example</option>
<option style="border: 0pt none; width: 30%; height: 19px;">WordNet</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Google</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Urban Dictionary</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Answers.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">rhymezone.com</option>
<option style="border: 0pt none; width: 30%; height: 19px;">Merriam-Webster</option>
</select>
<input id="LIU_search" style="border: 1px solid black; padding: 0pt; position: absolute; width: 68px; right: 68px; font-size: 14px ! important; height: 19px;" type="submit" value="Search" /><button id="LIU_prev" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 46px; height: 19px;">&lt;</button><button id="LIU_next" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 24px; height: 19px;">&gt;</button><button id="LIU_mode" style="border: 1px solid black; padding: 0pt; position: absolute; width: 20px; right: 2px; height: 19px;">0</button></div>
<div style="position: absolute; left: 2px; right: 0px; top: 22px;"><button id="LIU_0" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">w</button><button id="LIU_1" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">v</button><button id="LIU_2" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">c</button><button id="LIU_3" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">i</button><button id="LIU_4" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">d</button><button id="LIU_5" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">f</button><button id="LIU_6" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">j</button><button id="LIU_7" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">o</button><button id="LIU_8" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">g</button><button id="LIU_9" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">u</button><button id="LIU_10" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">a</button><button id="LIU_11" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">r</button><button id="LIU_12" style="border: 1px solid black; padding: 0pt; width: 20px; margin-right: 2px; height: 19px; background-color: white;">m</button></div>
</form>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/08/08/image-map-rollover-effects-using-jquerys-maphilight-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JQuery Image Dimensions</title>
		<link>http://www.electricfairground.com/2009/06/30/jquery-image-dimensions/</link>
		<comments>http://www.electricfairground.com/2009/06/30/jquery-image-dimensions/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 14:34:31 +0000</pubDate>
		<dc:creator>Lappa</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[dimensions]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://www.electricfairground.com/?p=28</guid>
		<description><![CDATA[<a href=http://www.electricfairground.com/2009/06/30/jquery-image-dimensions/><img src=image.png class=imgtfe hspace=5 align=left width=100  border=0></a>Simple code to grab the dimensions of any image on your page. Here&#8217;s an example: Tell JQuery to find out how big this image is by using: var width = $("#my_image").width(); var height = $("#my_image").height();]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.electricfairground.com%2F2009%2F06%2F30%2Fjquery-image-dimensions%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.electricfairground.com%2F2009%2F06%2F30%2Fjquery-image-dimensions%2F&amp;source=robinspots&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Simple code to grab the dimensions of any image on your page. Here&#8217;s an example:</p>
<pre class='brush: html'>
<img id="my_image" src="image.png" alt="My Image" />
</pre>
<p>Tell JQuery to find out how big this image is by using:</p>
<pre class='brush: js'>
var width = $("#my_image").width();
var height = $("#my_image").height();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.electricfairground.com/2009/06/30/jquery-image-dimensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
