<?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: jQuery CSS parser</title>
	<atom:link href="http://bililite.com/blog/2009/01/16/jquery-css-parser/feed/" rel="self" type="application/rss+xml" />
	<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/</link>
	<description>Thoughts on web design and programming from a very occasional volunteer webmaster</description>
	<lastBuildDate>Sun, 28 Feb 2010 22:17:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-692</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Fri, 31 Jul 2009 22:02:22 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-692</guid>
		<description>@ft:
Sure.  Just use
&lt;pre&gt;&lt;code&gt;$().parsecss(function(css){
	for (var selector in css){
		for (var property in css[selector]){
			if (property == &#039;border-radius&#039;){
				// fix it appropriately; css[selector][property] is the value
			}
		}
	}
});&lt;/code&gt;&lt;/pre&gt;
You still need to apply this only for IE (with conditional comments, $.browser or something. Up to you)
--Danny</description>
		<content:encoded><![CDATA[<p>@ft:<br />
Sure.  Just use</p>
<pre><code>$().parsecss(function(css){
	for (var selector in css){
		for (var property in css[selector]){
			if (property == 'border-radius'){
				// fix it appropriately; css[selector][property] is the value
			}
		}
	}
});</code></pre>
<p>You still need to apply this only for IE (with conditional comments, $.browser or something. Up to you)<br />
&#8211;Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ft</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-690</link>
		<dc:creator>ft</dc:creator>
		<pubDate>Fri, 31 Jul 2009 20:00:56 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-690</guid>
		<description>Thanks for sharing! Is it theoretically possible to modify your code that it searches for say &quot;border-radius&quot; and apply according actions for ie?</description>
		<content:encoded><![CDATA[<p>Thanks for sharing! Is it theoretically possible to modify your code that it searches for say &#8220;border-radius&#8221; and apply according actions for ie?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-554</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Sun, 03 May 2009 13:04:57 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-554</guid>
		<description>@MJ:
You are right. That&#039;s the problem with changing the name of the file (which I did in response to James Vivian above). I&#039;ve updated the link to the source code, made it version 1.1 (there was a minor bug fix) and removed the github link entirely, since it takes too much time to maintain it.
--Danny</description>
		<content:encoded><![CDATA[<p>@MJ:<br />
You are right. That&#8217;s the problem with changing the name of the file (which I did in response to James Vivian above). I&#8217;ve updated the link to the source code, made it version 1.1 (there was a minor bug fix) and removed the github link entirely, since it takes too much time to maintain it.<br />
&#8211;Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MJ</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-548</link>
		<dc:creator>MJ</dc:creator>
		<pubDate>Fri, 01 May 2009 22:01:36 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-548</guid>
		<description>Could you help clarify which js file is the most recent.  The Download code link doesn&#039;t go the correct file and is named differently than what&#039;s in the git repository.  However, both files are labeled in the comments as version 1.0 with differences between the two.  Thanks for the help in advance.</description>
		<content:encoded><![CDATA[<p>Could you help clarify which js file is the most recent.  The Download code link doesn&#8217;t go the correct file and is named differently than what&#8217;s in the git repository.  However, both files are labeled in the comments as version 1.0 with differences between the two.  Thanks for the help in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-507</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Fri, 03 Apr 2009 01:32:48 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-507</guid>
		<description>@James Vivian:
You&#039;re absolutely right! I can&#039;t imagine how I missed that. I&#039;m changing everything to &lt;code&gt;parsecss&lt;/code&gt; now.
Thanks for catching my idiocy.
-Danny</description>
		<content:encoded><![CDATA[<p>@James Vivian:<br />
You&#8217;re absolutely right! I can&#8217;t imagine how I missed that. I&#8217;m changing everything to <code>parsecss</code> now.<br />
Thanks for catching my idiocy.<br />
-Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Vivian</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-506</link>
		<dc:creator>James Vivian</dc:creator>
		<pubDate>Thu, 02 Apr 2009 21:05:43 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-506</guid>
		<description>Am I missing something, or has the linked code been updated beyond this post?  It seems like calls to $.cssparser should be $.parsecss instead.</description>
		<content:encoded><![CDATA[<p>Am I missing something, or has the linked code been updated beyond this post?  It seems like calls to $.cssparser should be $.parsecss instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Jaggi</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-461</link>
		<dc:creator>Thomas Jaggi</dc:creator>
		<pubDate>Fri, 13 Feb 2009 23:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-461</guid>
		<description>Thanks a lot for your help, now I&#039;m using the function above (with some changes to get it working in IE).</description>
		<content:encoded><![CDATA[<p>Thanks a lot for your help, now I&#8217;m using the function above (with some changes to get it working in IE).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danny</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-455</link>
		<dc:creator>Danny</dc:creator>
		<pubDate>Fri, 13 Feb 2009 02:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-455</guid>
		<description>@Thomas Jaggi:
The version I mentioned on the jQuery Google group actually returned a parsed object; it did not use a callback. It used synchronous Ajax, which is always a bad idea. The current version is better.
Parsing the CSS is probably not the best way of getting the styles of a specific class. You can go through the stylesheets (see this discussion, but realize the code is untested: http://groups.google.com/group/jquery-en/browse_thread/thread/a95f419f185f63dd/03df7ac2f2c82bfe), using something like this:
&lt;pre&gt;
function classStyle (className){
  var re = new RegExp(&#039;(^&#124;,)\\s*\\.&#039;+className+&#039;\\s*(,&#124;$)&#039;); 
  var style = &quot;&quot;;
  $.each (document.styleSheets, function(){
    $.each (this.cssRules &#124;&#124; this.rules, function() {
      if (re.test(this.selectorText)) style += this.style.cssText + &#039;;&#039;;
    });
  });
  return style;
} 
&lt;/pre&gt;
or see the jQuery UI code for animating classes for a clever trick: create an element, record the styles, then apply the class name and see what changed.
-Danny</description>
		<content:encoded><![CDATA[<p>@Thomas Jaggi:<br />
The version I mentioned on the jQuery Google group actually returned a parsed object; it did not use a callback. It used synchronous Ajax, which is always a bad idea. The current version is better.<br />
Parsing the CSS is probably not the best way of getting the styles of a specific class. You can go through the stylesheets (see this discussion, but realize the code is untested: <a href="http://groups.google.com/group/jquery-en/browse_thread/thread/a95f419f185f63dd/03df7ac2f2c82bfe)" rel="nofollow">http://groups.google.com/group/jquery-en/browse_thread/thread/a95f419f185f63dd/03df7ac2f2c82bfe)</a>, using something like this:</p>
<pre>
function classStyle (className){
  var re = new RegExp('(^|,)\\s*\\.'+className+'\\s*(,|$)');
  var style = "";
  $.each (document.styleSheets, function(){
    $.each (this.cssRules || this.rules, function() {
      if (re.test(this.selectorText)) style += this.style.cssText + ';';
    });
  });
  return style;
}
</pre>
<p>or see the jQuery UI code for animating classes for a clever trick: create an element, record the styles, then apply the class name and see what changed.<br />
-Danny</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Jaggi</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-452</link>
		<dc:creator>Thomas Jaggi</dc:creator>
		<pubDate>Thu, 12 Feb 2009 14:03:07 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-452</guid>
		<description>Whoups, my fault: I tried animating a z-index which killed IE.
But still: Is this also possible with the new version (just getting the styles of a specific class)? I understand this is not the main purpose but anyway...</description>
		<content:encoded><![CDATA[<p>Whoups, my fault: I tried animating a z-index which killed IE.<br />
But still: Is this also possible with the new version (just getting the styles of a specific class)? I understand this is not the main purpose but anyway&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Jaggi</title>
		<link>http://bililite.com/blog/2009/01/16/jquery-css-parser/comment-page-1/#comment-451</link>
		<dc:creator>Thomas Jaggi</dc:creator>
		<pubDate>Thu, 12 Feb 2009 13:21:54 +0000</pubDate>
		<guid isPermaLink="false">http://bililite.com/blog/?p=251#comment-451</guid>
		<description>Great work! Even if I don&#039;t really understand what&#039;s going on. ;)

Is it possible getting the styles of a specific class?

In the jQuery Google Group you have posted something like &quot;var style = $.parsecss()[&#039;.myclassname&#039;]; &quot;
Using this with the current version I get an error (&quot;str has no properties&quot;).

Using the script version on http://bililite.com/blog/blogfiles/cssparser/cssparser.jquery.js this works in Firefox but not in IE.

Thanks for your help.</description>
		<content:encoded><![CDATA[<p>Great work! Even if I don&#8217;t really understand what&#8217;s going on. <img src='http://bililite.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Is it possible getting the styles of a specific class?</p>
<p>In the jQuery Google Group you have posted something like &#8220;var style = $.parsecss()['.myclassname']; &#8220;<br />
Using this with the current version I get an error (&#8220;str has no properties&#8221;).</p>
<p>Using the script version on <a href="http://bililite.com/blog/blogfiles/cssparser/cssparser.jquery.js" rel="nofollow">http://bililite.com/blog/blogfiles/cssparser/cssparser.jquery.js</a> this works in Firefox but not in IE.</p>
<p>Thanks for your help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
