<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Pure CSS Rollover Map Demo &#8211; England Regions</title>
	<atom:link href="http://www.consil.co.uk/blog/2009/04/07/pure-css-rollover-map-demo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.consil.co.uk/blog/2009/04/07/pure-css-rollover-map-demo/</link>
	<description></description>
	<lastBuildDate>Tue, 10 May 2011 09:14:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jason</title>
		<link>http://www.consil.co.uk/blog/2009/04/07/pure-css-rollover-map-demo/#comment-30</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Sun, 21 Nov 2010 20:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.consil.co.uk/blog/?p=358#comment-30</guid>
		<description>Mitch - I won&#039;t have time to write a tutorial for a few weeks at least, but there are a few clues if you take a look at the image that is used to display the map:

http://www.consil.co.uk/blog/wp-content/uploads/2009/04/uk_regions_rollovers_pics.png

In short, this is how it works:

1. All required pictures are put into one big image with a transparent background.

2. Displaying any part of the image involves positioning a block where we want the image to be seen, setting it to the size of the bit of the image we want it to display, then setting the block&#039;s background to display the main image. The trick is to move the background image using negative positioning so that the block acts like a window onto a rectangle of the main image.

3. The overall map is one block, and each rollover area are individual blocks. All blocks are given the same background image, but the CSS hover selector is used to move the background image into view.

That&#039;s it really. The difficult part is knowing what positions to set everything to. The way I did that was to chop the image up in Inkscape using a pixel-based grid. I could then read off the pixel positions and sizes of each part of the image and plug them into the CSS stylesheets.

Think about the mechanism this way: it is constructed entirely of rectangle blocks positioned and sized absolutely within an overall rectangle block. A background image can be given to each block and that image can be slid up and down to display the bit we want that block to show. The CSS :hover pseudo-class is them used to do the shifting of that image.

It would be nice to be able to automate the creation of the whole thing, and I believe that Adobe Illustrator *does* do this now, and with polygonal rather than rectangle shapes, but that product is out of reach of many people. It does, however, involve messing around with tables of pixels in a spreadsheet at the moment. In theory the pixels can all be extracted from an image file (saved in SVG format) but that would involve a lot of work to put together.

Well, diagrams will certainly help to explain that a lot better, but I hope that overview helps to understand enough to maybe try it out for yourself.

You can save this page and play around with the stylesheet yourself to see how it works.</description>
		<content:encoded><![CDATA[<p>Mitch &#8211; I won&#8217;t have time to write a tutorial for a few weeks at least, but there are a few clues if you take a look at the image that is used to display the map:</p>
<p><a href="http://www.consil.co.uk/blog/wp-content/uploads/2009/04/uk_regions_rollovers_pics.png" rel="nofollow">http://www.consil.co.uk/blog/wp-content/uploads/2009/04/uk_regions_rollovers_pics.png</a></p>
<p>In short, this is how it works:</p>
<p>1. All required pictures are put into one big image with a transparent background.</p>
<p>2. Displaying any part of the image involves positioning a block where we want the image to be seen, setting it to the size of the bit of the image we want it to display, then setting the block&#8217;s background to display the main image. The trick is to move the background image using negative positioning so that the block acts like a window onto a rectangle of the main image.</p>
<p>3. The overall map is one block, and each rollover area are individual blocks. All blocks are given the same background image, but the CSS hover selector is used to move the background image into view.</p>
<p>That&#8217;s it really. The difficult part is knowing what positions to set everything to. The way I did that was to chop the image up in Inkscape using a pixel-based grid. I could then read off the pixel positions and sizes of each part of the image and plug them into the CSS stylesheets.</p>
<p>Think about the mechanism this way: it is constructed entirely of rectangle blocks positioned and sized absolutely within an overall rectangle block. A background image can be given to each block and that image can be slid up and down to display the bit we want that block to show. The CSS :hover pseudo-class is them used to do the shifting of that image.</p>
<p>It would be nice to be able to automate the creation of the whole thing, and I believe that Adobe Illustrator *does* do this now, and with polygonal rather than rectangle shapes, but that product is out of reach of many people. It does, however, involve messing around with tables of pixels in a spreadsheet at the moment. In theory the pixels can all be extracted from an image file (saved in SVG format) but that would involve a lot of work to put together.</p>
<p>Well, diagrams will certainly help to explain that a lot better, but I hope that overview helps to understand enough to maybe try it out for yourself.</p>
<p>You can save this page and play around with the stylesheet yourself to see how it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mitch</title>
		<link>http://www.consil.co.uk/blog/2009/04/07/pure-css-rollover-map-demo/#comment-29</link>
		<dc:creator>Mitch</dc:creator>
		<pubDate>Sun, 21 Nov 2010 20:13:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.consil.co.uk/blog/?p=358#comment-29</guid>
		<description>These maps are great! Any chance you have a tutorial or something for a novice like me? Can&#039;t seem to find any solution (jquery or css) that actually provides instructions. It&#039;s like everyone assumes everyone else knows how to do all this.

Thanks!</description>
		<content:encoded><![CDATA[<p>These maps are great! Any chance you have a tutorial or something for a novice like me? Can&#8217;t seem to find any solution (jquery or css) that actually provides instructions. It&#8217;s like everyone assumes everyone else knows how to do all this.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

