<?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>XEWeb &#187; CSS</title>
	<atom:link href="http://www.xeweb.net/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xeweb.net</link>
	<description>XEWeb blog, PHP scripts and more...</description>
	<lastBuildDate>Mon, 16 Aug 2010 15:07:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Thumbnail opacity hover with CSS and jQuery</title>
		<link>http://www.xeweb.net/2010/03/22/thumbnail-opacity-hover-with-css-and-jquery/</link>
		<comments>http://www.xeweb.net/2010/03/22/thumbnail-opacity-hover-with-css-and-jquery/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 16:32:38 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.xeweb.net/?p=123</guid>
		<description><![CDATA[A nice effect when hovering over thumbnails is to change the opacity, so that it has that fade in and out effect. &#60;ul class=&#34;thumbnails&#34;&#62; &#160;&#60;li&#62;&#60;a href=&#34;#&#34;&#62;&#60;img src=&#34;thumb-1.jpg&#34; alt=&#34;&#34; /&#62;&#60;/a&#62;&#60;/li&#62; &#160;&#60;li&#62;&#60;a href=&#34;#&#34;&#62;&#60;img src=&#34;thumb-2.jpg&#34; alt=&#34;&#34; /&#62;&#60;/a&#62;&#60;/li&#62; &#160;&#60;li&#62;&#60;a href=&#34;#&#34;&#62;&#60;img src=&#34;thumb-3.jpg&#34; alt=&#34;&#34; /&#62;&#60;/a&#62;&#60;/li&#62; &#160;&#60;li&#62;&#60;a href=&#34;#&#34;&#62;&#60;img src=&#34;thumb-4.jpg&#34; alt=&#34;&#34; /&#62;&#60;/a&#62;&#60;/li&#62; &#160;&#60;li&#62;&#60;a href=&#34;#&#34;&#62;&#60;img src=&#34;thumb-5.jpg&#34; alt=&#34;&#34; /&#62;&#60;/a&#62;&#60;/li&#62; &#60;/ul&#62; Take the above example, a [...]]]></description>
			<content:encoded><![CDATA[<p>A nice effect when hovering over thumbnails is to change the opacity, so that it has that fade in and out effect.</p>
<div class="html4strict geshi no html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumbnails&quot;</span>&gt;</span><br />
&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb-1.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb-2.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb-3.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb-4.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;thumb-5.jpg&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span></div>
<p>Take the above example, a simple list of images. Let&#8217;s apply the basic styling for it&#8230;</p>
<div class="css geshi no css" style="font-family:monospace;">ul<span style="color: #6666ff;">.thumbnails</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
ul<span style="color: #6666ff;">.thumbnails</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
ul<span style="color: #6666ff;">.thumbnails</span> li img <span style="color: #00AA00;">&#123;</span> filter<span style="color: #00AA00;">:</span> alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">60</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* IE only */</span> opacity<span style="color: #00AA00;">:</span> .60<span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* All other browsers */</span> <span style="color: #00AA00;">&#125;</span></div>
<p>As you can see all of the thumbnails will have a default opacity of 60%. Now comes the jQuery script to add the fade effect&#8230;</p>
<div class="javascript geshi no javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp;$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&#39;ul.thumbnails li&#39;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&#39;img&#39;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&#39;img&#39;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">0.6</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div>
<p>And that&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xeweb.net/2010/03/22/thumbnail-opacity-hover-with-css-and-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pure CSS coke can spin</title>
		<link>http://www.xeweb.net/2010/02/20/pure-css-coke-can-spin/</link>
		<comments>http://www.xeweb.net/2010/02/20/pure-css-coke-can-spin/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 10:40:51 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.xeweb.net/?p=121</guid>
		<description><![CDATA[This just goes to show what you can do with CSS these days as Rom&#225;n Cort&#233;s demonstrates with his awesome spinning coke can example. I found out that by a combination of the CSS1 properties background-attachment and background-position, 2D displacement maps could be created and, by scrolling, the displacement map would be applied to different [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.xeweb.net/wp-content/uploads/css-coke-can.jpg" alt="Pure CSS coke can spin" width="180" height="134" class="alignleft size-full wp-image-122" />This just goes to show what you can do with CSS these days as Rom&aacute;n Cort&eacute;s demonstrates with his awesome spinning coke can example.</p>
<blockquote><p>I found out that by a combination of the CSS1 properties background-attachment  and background-position, 2D displacement maps could be created and, by scrolling, the displacement map would be applied to different parts of the texture (a background image).</p>
<p>With displacement maps lots of cool effects could be done, but thinking that the complexity of the displacement map would directly affect the CSS and markup size, choosing a good example took me some time. I thought in sea waves reflections, underwater distortions, magnifying glass, a rotating Earth… but the final thing I did was just right in my desktop: a Coke can &#8211; my favourite drink.</p>
<p>Due the cilindrical shape of a can, the displacement map is very simple with the parallel projection I did, so the code is very little &#8211; below 5kb &#8211; and easy to understand I hope.</p>
<p>Even if this effect is mainly CSS1 and some bits of CSS2 &#8211; for the scrolling div, overflow: auto property -, it is not going to work in IE6, because it doesn’t support background-attachment: fixed. I’ve tested it and it works in IE8, Firefox 3.5, Chrome 3, Safari 4 and Opera 10. Also, the code validates.</p></blockquote>
<p>Check it out at <a href="http://www.romancortes.com/blog/pure-css-coke-can/">http://www.romancortes.com/blog/pure-css-coke-can/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.xeweb.net/2010/02/20/pure-css-coke-can-spin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
