<?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>can&#039;t use it &#187; css</title>
	<atom:link href="http://cantuse.it/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://cantuse.it</link>
	<description>A blog about good and bad usability, user interface design, prototyping, web application development, computer science and everything else.</description>
	<lastBuildDate>Sun, 06 Mar 2011 00:27:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quirky Proof of Concept: Automatic transition animation for CSS hovers (CSS transitions for older browsers)</title>
		<link>http://cantuse.it/2009/12/proof-of-concept-automatic-transition-animation-for-css-hovers-with-jquery/</link>
		<comments>http://cantuse.it/2009/12/proof-of-concept-automatic-transition-animation-for-css-hovers-with-jquery/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 06:32:59 +0000</pubDate>
		<dc:creator>cemre</dc:creator>
				<category><![CDATA[webdev]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://www.cantuse.it/?p=287</guid>
		<description><![CDATA[I coded some javascript to emulate css transitions for older browsers. It works by parsing the CSS of the page, determining rules which also have a :hover state, then attaching itself to onmouseover/onmouseout events and animating according to the hovered definition in CSS.
Here&#8217;s the quirky proof of concept and you can read the source to [...]]]></description>
			<content:encoded><![CDATA[<p>I coded some javascript to emulate css transitions for older browsers. It works by parsing the CSS of the page, determining rules which also have a :hover state, then attaching itself to onmouseover/onmouseout events and animating according to the hovered definition in CSS.</p>
<p><a href="http://cemre.gr/projects/hover-transition-animation/">Here&#8217;s the quirky proof of concept</a> and you can read the source to look at the code as well. It&#8217;s quite a dirty solution:</p>
<ul>
<li>IE has different ways of accessing the stylesheet, didn&#8217;t implement that</li>
<li>It&#8217;s probably very inefficient to iterate over all styles to get the hovered rules. Moreover, for each hovered rule, I search through the style rules again to find the un-hovered rule (O(n<sup>2</sup>) :)). Probably indexing all rules in a JS array would make things faster because of direct access? Another good idea if making the user provide all selectors which should be hover-animated.</li>
<li>It goes wonky if attributes that can&#8217;t be animated are defined (like font-family). I should probably make a list of all &#8220;animatable&#8221; attributes and only work on them.</li>
<li>It doesn&#8217;t account for default styles defined with a browser style-sheet (doesn&#8217;t restore them on mouseout)</li>
<li>For some reason margin-left and margin-right aren&#8217;t read in Firefox?</li>
</ul>
<p>Anyway here&#8217;s the thing: <a href="http://cemre.gr/projects/hover-transition-animation/">Automatic transition animation for CSS hovers with jQuery.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cantuse.it/2009/12/proof-of-concept-automatic-transition-animation-for-css-hovers-with-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

