<?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>Slicer at work</title>
	<atom:link href="http://www.sliceratwork.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sliceratwork.com</link>
	<description>Fixing CSS bugs one at a time</description>
	<lastBuildDate>Mon, 30 Aug 2010 17:42:11 +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>Detect browser plugins with javascript</title>
		<link>http://www.sliceratwork.com/detect-installed-browser-plugins-using-javascript</link>
		<comments>http://www.sliceratwork.com/detect-installed-browser-plugins-using-javascript#comments</comments>
		<pubDate>Mon, 30 Aug 2010 10:54:00 +0000</pubDate>
		<dc:creator>slicer</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.sliceratwork.com/?p=639</guid>
		<description><![CDATA[While working on a project a few days ago, I needed to know if the user had Flash or QuickTime installed. After a little bit of searching I found a few solutions online. This gave me the idea to create a script that checks for plug-ins installed in a browser. I know there are a [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a project a few days ago, I needed to know if the user had Flash or QuickTime installed. After a little bit of searching I found a few solutions online.</p>
<p>This gave me the idea to create a script that checks for plug-ins installed in a browser. I know there are a lot of scripts of this nature online, but if you have the time, check out mine as well, you might find it useful.</p>
<p>The basic idea was to be able to do something like this:</p>
<pre class="brush: jscript;">
if(plugin.available) {
	do this;
} else {
	do that;
}</pre>
<p>In standard compliant browsers it&#8217;s pretty easy to check if a plug-in is installed. You use the <code>navigator</code> object and check the <code>mimeTypes</code> property.</p>
<pre class="brush: jscript;">
if(navigator.mimeTypes &amp;&amp; window.console &amp;&amp; window.console.log){
	for(var p in navigator.mimeTypes){
		window.console.log(navigator.mimeTypes[p]);
	}
}</pre>
<p>Let me explain the code above a bit. We are doing what is called <strong>object detection</strong> or <strong>feature detection</strong>. We are basically testing to see if the browser supports a certain method or property. In this case we are first testing to see if the browser supports the <code>mimeTypes</code> property of the <code>navigator</code> object.</p>
<p>This property returns the <code>mimeTypes</code> that the browser in question supports. Then we test to see if our browser supports the <code>console</code> object and it&#8217;s <code>log</code> method.</p>
<p>If all those conditions are met, then we loop through all of the items in the <code>navigator.mimeTypes</code> property and log each one in the console.</p>
<p>We will get a list of <strong>objects that represent our installed plug-ins</strong>. We can log the <code>type</code> of each item to see the <code>mimeType</code>.</p>
<pre class="brush: jscript;">
if(navigator.mimeTypes &amp;&amp; window.console &amp;&amp; window.console.log){
	for(var p in navigator.mimeTypes){
		window.console.log(navigator.mimeTypes[p].type);
	}
}</pre>
<p>You will get something like this:</p>
<pre class="brush: jscript;">
application/googletalk
application/vnd.gtpo3d.auto
application/x-CorelXARA
application/vnd.xara
image/vnd.djvu
image/x.djvu
image/x-djvu
image/x-iw44
image/x-dejavu
image/djvu</pre>
<p>The actual content that will be logged in the console depends on what plug-ins you have installed, so your results may be different from mine.</p>
<p>The problem is that in <abbr title="Internet Explorer">IE</abbr>, the <code>navigator.mimeTypes</code> gives us no info about the plug-ins installed(Thanks Microsoft). If we want to check for a plug-in in <abbr title="Internet Explorer">IE</abbr> we have to use the <code>ActiveX</code> control. Again, we have to do a little bit of <strong>JavaScript feature detection</strong>. Since <abbr title="Internet Explorer">IE</abbr> is the only browser that recognizes <strong><code>ActiveX</code> controls</strong>, if we try to create a <code>new ActiveXObject</code> without checking for support first, standard compliant browsers will throw errors.</p>
<p>We first check to see if the browser knows what an <code>ActiveXObject</code> is:</p>
<pre class="brush: jscript;">
if (typeof ActiveXObject != 'undefined') {
	try {
		new ActiveXObject('ActiveXObjectName');
	}
	catch (err) {
	}
}
</pre>
<p>Then we use a <code>try{} catch(){}</code> statement, because if we did something like:</p>
<pre class="brush: jscript;">
if(typeof new ActiveXObject('ActiveXObjectName') != 'undefined'){
	....
}
</pre>
<p><abbr title="Internet Explorer">IE</abbr> would throw an error if we passed in an argument it did not recognize.</p>
<p>So let&#8217;s get started on our code. First we need to create an object that we will use to store information on our plug-ins in:</p>
<pre class="brush: jscript;">
var installedPlugins = {
};</pre>
<p>The next step is to add properties to that object. A very simple one to add is support for <code>Java</code>:</p>
<pre class="brush: jscript;">var installedPlugins = {
	'java': navigator.javaEnabled()
};</pre>
<p>If <code>Java</code> is installed, <code>installedPlugins.java</code> will return <code>true</code> , else it will return <code>false</code>.</p>
<p>The next step is to create a self invoking anonymous function. This is done to protect the global scope.</p>
<pre class="brush: jscript;">(function(){
....
})()</pre>
<p>Now we need to create an object that holds the plug-ins we want to check for. There are literally hundreds of <strong>browser plug-ins</strong> on the out there, I have made this script to test only for some of the most popular.</p>
<pre class="brush: jscript;">var plugins = {
	'flash': {
		'mimeType': ['application/x-shockwave-flash'],
		'ActiveX': ['ShockwaveFlash.ShockwaveFlash', 'ShockwaveFlash.ShockwaveFlash.3', 'ShockwaveFlash.ShockwaveFlash.4', 'ShockwaveFlash.ShockwaveFlash.5', 'ShockwaveFlash.ShockwaveFlash.6', 'ShockwaveFlash.ShockwaveFlash.7']
	},
	'shockwave-director': {
		'mimeType': ['application/x-director'],
		'ActiveX': ['SWCtl.SWCtl', 'SWCt1.SWCt1.7', 'SWCt1.SWCt1.8', 'SWCt1.SWCt1.9', 'ShockwaveFlash.ShockwaveFlash.1']
	},
	..........
	'quicktime': {
		'mimeType': ['video/quicktime'],
		'ActiveX': ['QuickTime.QuickTime', 'QuickTimeCheckObject.QuickTimeCheck.1', 'QuickTime.QuickTime.4']
	},
	'windows-media-player': {
		'mimeType': ['application/x-mplayer2'],
		'ActiveX': ['WMPlayer.OCX', 'MediaPlayer.MediaPlayer.1']
	}
};</pre>
<p>Our object contains a list of <strong>plug-in names</strong>. Each plug-in has two properties: <code>mimeType</code> and <code>ActiveX</code>. <code>mimeType</code> is used for checking in standard compliant browsers and <code>ActiveX</code> is used for <abbr title="Internet Explorer">IE</abbr>.</p>
<p>Now that we have our <strong>plug-ins object</strong> set up, we need to create the function that will check for support:</p>
<pre class="brush: jscript;">//check support for a plugin
function checkSupport(p){
	var support = false;
	//for standard compliant browsers
	if (navigator.mimeTypes) {
		for (var i = 0; i &lt; p['mimeType'].length; i++) {
			if (navigator.mimeTypes[p['mimeType'][i]] &amp;&amp; navigator.mimeTypes[p['mimeType'][i]].enabledPlugin) {
			support = true;
			}
		}
	}
	//for IE
	if (typeof ActiveXObject != 'undefined') {
		for (var i = 0; i &lt; p['ActiveX'].length; i++) {
			try {
				new ActiveXObject(p['ActiveX'][i]);
				support = true;
			}
			catch (err) {
			}
		}
	}
	return support;
}</pre>
<p>We start by creating a function called <code>checkSupport()</code>. This function accepts one parameter, or argument and that is the plug-in we are testing for. The function returns <code>true</code> if it finds that a certain <code>mimeType</code> or <code>ActiveX control</code> is supported by the browser and <code>false</code> otherwise.</p>
<p>Now that we have our function set up, we need to loop over the plug-ins in our <code>plugins</code> object and test to see if each one is installed or not.</p>
<pre class="brush: jscript;">//we loop through all the plugins
for (plugin in plugins) {
	//if we find one that's installed...
	if (checkSupport(plugins[plugin])) {
		//we add a property that matches that plugin's name to our &quot;installedPlugins&quot; object and set it's value to &quot;true&quot;
		installedPlugins[plugin] = true;
		//and add a class to the html element, for styling purposes
		document.documentElement.className += ' ' + plugin;
	}
	else {
		installedPlugins[plugin] = false;
	}
}</pre>
<p>To <strong>test if a browser plug-in is installed</strong> you need to check the <code>installedPlugins</code> object. Like this:</p>
<pre class="brush: jscript;">if(installedPlugins.flash){
....
} else if(installedPlugins.quicktime){
....
} else if(installedPlugins.windows-media-player){
}</pre>
<p>A class containing the plug-in&#8217;s name is added to the <code>html</code> element, just in case you need to style the page differently if a plug-in is installed/missing.</p>
<pre class="brush: xml;">
&lt;html class=&quot;3dmlw djvu google-talk flash shockwave-director quicktime windows-media-player pdf vlc xara silverlight&quot;&gt;
</pre>
<p>Please note that this script only checks for a few plug-ins, those which are most used. If you wish to check for another plug-in you will need to add the necessary info to the <code>plugins</code> object.</p>
<p>If you find any problems with the code or have any suggestions on how to improve it, please leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sliceratwork.com/detect-installed-browser-plugins-using-javascript/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gravity forms PayPal integration</title>
		<link>http://www.sliceratwork.com/gravity-forms-paypal-integration</link>
		<comments>http://www.sliceratwork.com/gravity-forms-paypal-integration#comments</comments>
		<pubDate>Tue, 10 Aug 2010 21:38:58 +0000</pubDate>
		<dc:creator>slicer</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[gravity forms]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.sliceratwork.com/?p=600</guid>
		<description><![CDATA[Gravity Forms is one of the best WordPress form plugins out there. It makes form building very easy. You can create all kinds of fields: text, textarea, email, phone and even reorder the the fields using drag and drop. One thing i found was lacking though, is PayPal integration. But we can do that pretty [...]]]></description>
			<content:encoded><![CDATA[<p>Gravity Forms is one of the best WordPress form plugins out there. It makes form building very easy.</p>
<p>You can create all kinds of fields: text, textarea, email, phone and even reorder the the fields using drag and drop. One thing i found was lacking though, is <strong>PayPal integration</strong>. But we can do that pretty easy with <strong>query strings</strong>.</p>
<p>A <strong>query string</strong> is the part of a <abbr title="Uniform Resource Locator">URL</abbr> that contains data to be passed to web applications. Here&#8217;s and example:</p>
<pre class="brush: xml;">http://www.sliceratwork.com/contact?param1=value1&amp;param2=value2&amp;param3=value3</pre>
<p>We can use <strong>query strings</strong> to send data to PayPal for things like donations or a payment form for a service, like I have <a href="http://www.sliceratwork.com/#gform_2">here</a>.</p>
<p>First you will need to have a licensed copy of <a href="http://www.gravityforms.com/">gravity forms</a>.</p>
<p>After you download and install the plugin, you will have to create a form.</p>
<p>In the admin panel, you need to go to Forms-&gt;New form. You will see something similar to this.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-untitled-form.png"><img class="alignnone size-medium wp-image-606" title="Gravity Forms untitled form" src="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-untitled-form-300x138.png" alt="Gravity Forms untitled form" width="300" height="138" /></a></p>
<p>Click on the form and edit the title and description to something that suits you.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-payment-form1.png"><img class="alignnone size-medium wp-image-614" title="Gravity Forms PayPal form" src="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-payment-form1-300x293.png" alt="Gravity Forms PayPal form" width="300" height="293" /></a></p>
<p>Now let&#8217;s add some fields to our form. You&#8217;ll find the form fields panel on the right side of the admin.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-payment-form3.png"><img class="alignnone size-medium wp-image-616" title="Gravity Forms PayPal form" src="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-payment-form3-255x300.png" alt="Gravity Forms PayPal form" width="255" height="300" /></a></p>
<p>Now that you have added your fields you need to click on the Confirmation tab and tick the Redirect radio button and the Query String checkbox.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-payment-form-confirmation.png"></a><a href="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-payment-form4.png"><img class="alignnone size-medium wp-image-618" title="Gravity Forms PayPal form" src="http://www.sliceratwork.com/wp-content/uploads/2010/08/gravity-forms-payment-form4-300x295.png" alt="Gravity Forms PayPal form" width="300" height="295" /></a></p>
<p>In the <abbr title="Uniform Resource Locator">URL</abbr> text field you need to add:</p>
<pre class="brush: xml;">https://www.paypal.com/cgi-bin/webscr</pre>
<p>and in the Query String field:</p>
<pre class="brush: xml;">cmd=_xclick&amp;business=example@example.com&amp;item_name={Why ?:3}&amp;amount={Amount:4}&amp;currency_code={Currency:5}&amp;return=http://www.example.com</pre>
<p>Here  are a few of the parameters we are passing in the <strong>query string</strong>.</p>
<ul>
<li><code>business</code>: that will be the email address you use for your PayPal account</li>
<li><code>item_name</code>: the item or service for which people are paying you</li>
<li><code>amount</code>: the amount of money they are sending you</li>
<li><code>currency_code</code>: the type of currency(USD, EUR, GBP)</li>
<li><code>return</code>: the <abbr title="Uniform Resource Locator">URL</abbr> to which people will be redirected after they make the PayPal transaction</li>
</ul>
<p>The settings used above are purely for demonstrative purposes. Please replace them with your desired values.</p>
<p>To add a field reference to the query string,  place the text cursor where you want to insert the field and choose from the <strong>Insert form field</strong> select.</p>
<p>After you fill in the form and hit submit, you will be redirected to PayPal.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/08/PayPal-login-form.png"><img class="alignnone size-medium wp-image-624" title="PayPal-login-form" src="http://www.sliceratwork.com/wp-content/uploads/2010/08/PayPal-login-form-300x240.png" alt="" width="300" height="240" /></a></p>
<p>Notice that the business name, item description and amount appear in the top side of the PayPal interface.</p>
<p>After you complete the PayPal transaction you will be redirected to the <abbr title="Uniform Resource Locator">URL</abbr> you used for the <code>return</code> parameter.</p>
<p>Here is some useful info about <a href="https://www.paypalobjects.com/en_US/ebook/PP_NVPAPI_DeveloperGuide/Appx_fieldreference.html">PayPal objects</a> and <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_prepopulate_outside">pre-populating PayPal fields</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sliceratwork.com/gravity-forms-paypal-integration/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Open external links in a new window</title>
		<link>http://www.sliceratwork.com/open-external-links-in-a-new-window</link>
		<comments>http://www.sliceratwork.com/open-external-links-in-a-new-window#comments</comments>
		<pubDate>Mon, 09 Aug 2010 10:22:00 +0000</pubDate>
		<dc:creator>slicer</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.sliceratwork.com/?p=530</guid>
		<description><![CDATA[Getting external links to open in a new window is actually pretty easy, you just have to set each link&#8217;s target attribute to _blank, like this: &#60;a href=&#34;http://www.google.com&#34; target=&#34;_blank&#34;&#62;Google&#60;/a&#62; There are two problems with this: 1. you have to go through all the links and add the necessary code 2. you can&#8217;t use the target [...]]]></description>
			<content:encoded><![CDATA[<p>Getting <strong>external links to open in a new window</strong> is actually pretty easy, you just have to set each link&#8217;s <code>target</code> attribute to <code>_blank</code>, like this:</p>
<pre class="brush: xml;">&lt;a href=&quot;http://www.google.com&quot; target=&quot;_blank&quot;&gt;Google&lt;/a&gt;</pre>
<p>There are two problems with this:</p>
<p>1. you have to go through all the links and add the necessary code<br />
2. you can&#8217;t use the <code>target</code> attribute in <abbr title="eXtensible Hypertext Markup Language">XHTML</abbr> strict. It will invalidate your code</p>
<p>We can use JavaScript to solve both of those problems. Here&#8217;s the code:</p>
<pre class="brush: jscript;">var hostname = window.location.hostname,
links = document.getElementsByTagName('a'),
pattern = /^https?:\/\/(www.)?/i;

for(var i=0, len = links.length; i&lt;len; i++) {
  if(pattern.test(links[i].href) &amp;&amp; links[i].href.toLowerCase().indexOf(hostname) == -1){
    links[i].target = &quot;_blank&quot;;
    links[i].className += ' external';
  }
}</pre>
<p>Here&#8217;s a short explanation of the code above.</p>
<p>First we store the hostname in a variable called <code>hostname</code>. The hostname is the part of the <abbr title="Uniform Resource Locator">URL</abbr> that contains your domain name , plus the domain extension.</p>
<p>In my case the hostname is sliceratwork.com. You can learn more about <code>window.hostname</code> <a href="http://www.w3schools.com/jsref/obj_location.asp">here</a>.</p>
<pre class="brush: jscript;">var hostname = window.location.hostname;</pre>
<p>Now we grab all the links on the page and store a reference to them in a variable called <code>links</code>.</p>
<pre class="brush: jscript;">var links = document.getElementsByTagName('a');</pre>
<p>Then we create a new <abbr title="Regular expression">RegExp</abbr> that we will use to check the <code>href</code> attribute of each links and store that in a variable called <code>pattern</code>.</p>
<p>This RegExp checks to see if the protocol of the <abbr title="Uniform Resource Locator">URL</abbr> we are testing is either <code>http</code> or <code>https</code>. We want to filter things like <code>mailto:</code> links.</p>
<pre class="brush: jscript;">pattern = /^https?:\/\/(www.)?/i;</pre>
<p>Now we cycle through the links using a <code>for</code> loop:</p>
<pre class="brush: jscript;">for(var i=0, len = links.length; i&lt;len; i++) { ... }</pre>
<p>We check to see if the current link&#8217;s <code>href</code> attribute matches our pattern:</p>
<pre class="brush: jscript;">if(pattern.test(links[i].href)){ ... }</pre>
<p>and if it points to our domain or another one:</p>
<pre class="brush: jscript;">links[i].href.toLowerCase().indexOf(hostname) == -1</pre>
<p>If both those conditions return <code>true</code>, we set that link&#8217;s <code>target</code> attribute to <code>_blank</code> and append &#8220;external&#8221; to it&#8217;s class(es).</p>
<pre class="brush: jscript;">links[i].target = '_blank';
links[i].className += ' external';</pre>
<p>The <code>target</code> attribute makes the <strong>link open in a new window</strong> and the <code>class</code> is for styling purposes. For example all your links can be blue, but any <strong>external link</strong> will be pink.</p>
<pre class="brush: css;">a {
color: blue;
}

a.external {
color: pink;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sliceratwork.com/open-external-links-in-a-new-window/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress autocomplete for Aptana</title>
		<link>http://www.sliceratwork.com/wordpress-autocomplete-for-aptana</link>
		<comments>http://www.sliceratwork.com/wordpress-autocomplete-for-aptana#comments</comments>
		<pubDate>Thu, 15 Jul 2010 15:09:13 +0000</pubDate>
		<dc:creator>slicer</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[aptana]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://slicer.dev/?p=357</guid>
		<description><![CDATA[We all have our favorite editor, be it Dreamweaver, TextMate, Coda and so on. I use Aptana for most of my work. I really like it because it has a lot of cool features like: it shows browser support for CSS properties, JS libraries autocomplete (like jQuery, Mootools and so on).  But I couldn&#8217;t find [...]]]></description>
			<content:encoded><![CDATA[<p>We all have our favorite editor, be it Dreamweaver, TextMate, Coda and so on. I use Aptana for most of my work.</p>
<p>I really like it because it has a lot of cool features like: it shows browser support for <strong><abbr title="Cascading Style Sheets">CSS</abbr> properties</strong>, <abbr title="Javascript"><strong>JS</strong></abbr> libraries autocomplete (like jQuery, Mootools and so on).  But I couldn&#8217;t find WordPress autocomplete anywhere.</p>
<p>After searching the web for a while, I found <a href="http://www.ilovecolors.com.ar/wordpress-code-templates-for-aptana/">this</a>. The file provided by <a href="http://www.ilovecolors.com">ilovecolors.com</a> is cool, but it has very few <strong>WordPress template tags</strong>, so I thought I&#8217;d add all the template tags on <a href="http://codex.wordpress.org/Template_Tags">wordpress.org</a>. So let&#8217;s get started.</p>
<p>First you need to install <abbr title="Hypertext Preprocessor">PHP</abbr> in Aptana.</p>
<p>Open up Aptana and go to <code>Aptana-&gt;Help-&gt;Install new software</code>. A dialog box will appear. In the &#8220;Work with:&#8221; field type <code>http://update.aptana.com/install/php</code> then select <strong>Aptana <abbr title="Hypertext Preprocessor">PHP</abbr></strong> and install it.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/07/install-aptana-php.png"><img class="alignnone size-medium wp-image-365" title="Install aptana PHP" src="http://www.sliceratwork.com/wp-content/uploads/2010/07/install-aptana-php-300x256.png" alt="Install aptana PHP" width="300" height="256" /></a></p>
<p>Accept the license and restart Aptana. Now you need to go to <code>Window-&gt;Preferences-&gt;Aptana-&gt;Editors-&gt;PHP-&gt;Editing-&gt;Templates.</code></p>
<p>Click &#8220;Import&#8221; and browse to the location of the <strong>WordPress template tags</strong> <abbr title="eXtensible Markup Language">XML</abbr> file. After that you should see some new entries in the Templates window. In the description field look for &#8220;WP:&#8221;.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/07/wordpress-autocomplete-for-aptana.png"><img class="alignnone size-medium wp-image-522" title="Wordpress autocomplete for Aptana" src="http://www.sliceratwork.com/wp-content/uploads/2010/07/wordpress-autocomplete-for-aptana-300x221.png" alt="Wordpress autocomplete for Aptana" width="300" height="221" /></a></p>
<p>Now to use the templates open up a <abbr title="Hypertext Preprocessor">PHP</abbr> file and type for example <code>the_</code>. The autocomplete box will pop up and show all relevant results.</p>
<p><a href="http://www.sliceratwork.com/wp-content/uploads/2010/07/aptana-wordpress-template-tags-sample.png"><img class="alignnone size-medium wp-image-372" title="Aptana WordPress template tags" src="http://www.sliceratwork.com/wp-content/uploads/2010/07/aptana-wordpress-template-tags-sample-300x256.png" alt="Aptana WordPress template tags" width="300" height="256" /></a></p>
<p>If you find any errors or have any suggestions about the code, please let me know in the comments section.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sliceratwork.com/wordpress-autocomplete-for-aptana/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FamFamFam CSS image sprites</title>
		<link>http://www.sliceratwork.com/famfamfam-css-image-sprites</link>
		<comments>http://www.sliceratwork.com/famfamfam-css-image-sprites#comments</comments>
		<pubDate>Sun, 11 Jul 2010 22:49:18 +0000</pubDate>
		<dc:creator>slicer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[icons]]></category>
		<category><![CDATA[image sprites]]></category>

		<guid isPermaLink="false">http://slicer.dev/?p=248</guid>
		<description><![CDATA[Hi guys. I bet most of you have heard of CSS sprites and their benefits. If not, I&#8217;ll give you a crash course in sprites. An image sprite is basically a matrix of images.You take a bunch of images and merge them into one. Then you use CSS background-position to control which part of the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys.</p>
<p>I bet most of you have heard of <strong><abbr title="Cascading Style Sheets">CSS</abbr> sprites</strong> and their benefits.</p>
<p>If not, I&#8217;ll give you a crash course in sprites.</p>
<p>An <strong>image sprite</strong> is basically a matrix of images.You take a bunch of images and merge them into one. Then you use <strong><abbr title="Cascading Style Sheets">CSS</abbr></strong> <code>background-position</code> to control which part of the image you want to show.</p>
<p>Why would you do that, I hear you say?</p>
<p>The answer is simple: to cut down on <abbr title="HyperText Transfer Protocol">HTTP</abbr> requests. The more <abbr title="HyperText Transfer Protocol">HTTP</abbr> requests  your web page makes, the longer it will take to load.</p>
<p>You may not feel the difference when there are few files involved, but when we are talking about over 1000 images, that&#8217;s a lot of <abbr title="HyperText Transfer Protocol">HTTP</abbr> requests.</p>
<p>Almost all web pages you&#8217;ll find on the Internet will have at least a few icons, like a <abbr title="Really Simple Syndication">RSS</abbr> feed icon or a person icon for the login link.</p>
<p>One of the most used icon pack is the one from <a href="http://www.famfamfam.com">famfamfam</a> (1000+ icons).</p>
<p>So let&#8217;s turn that icon pack into a sprite shall we? For this we&#8217;ll use the <a href="http://spritegen.website-performance.org/"><strong><abbr title="Cascading Style Sheets">CSS</abbr> Sprite Generator</strong></a>.</p>
<p><a href="http://slicer.dev/wp-content/uploads/2010/07/css-sprite-generator.jpg"><img class="alignnone size-medium wp-image-264" title="CSS sprite generator" src="http://slicer.dev/wp-content/uploads/2010/07/css-sprite-generator-300x144.jpg" alt="CSS sprite generator" width="300" height="144" /></a></p>
<p>The process is pretty simple: download the ZIP file from <a href="http://www.famfamfam.com/lab/icons/silk/">famfamfam</a> and upload it to the sprite generator. You can fiddle around with the options or leave them to their default values.</p>
<p>After you click &#8220;Create Sprite Image &amp; CSS&#8221; you will be presented with a link to download the <strong>image sprite</strong> and the <strong><abbr title="Cascading Style Sheets">CSS</abbr> code</strong>. You will get something like this:</p>
<pre class="brush: css;">
.icon-add {background-position: 0 0;}
.icon-anchor {background-position: 0 -26px;}
.icon-application {background-position: 0 -52px;}
.icon-application-add {background-position: 0 -78px;}
.icon-application-cascade {background-position: 0 -104px;}
.icon-application-delete {background-position: 0 -130px;}</pre>
<p>Save that file to something like <code>icons.css</code> and include it  in your page and copy the <strong>image sprite</strong> in your images folder. Make sure the paths in the <strong><abbr title="Cascading Style Sheets"><abbr title="Cascading Style Sheets">CSS</abbr></abbr></strong> file file match the path of your image.</p>
<p>At the top of your icons.css file add the following rules:</p>
<pre class="brush: css;">.icon {
 display: inline;
 display: -moz-inline-stack;
 display: inline-block;
 zoom: 1;
 width: 16px;
 height: 16px;
 overflow: hidden;
 padding: 0;
 border: 0;
 margin: 0;
 vertical-align: middle;
 line-height: 0;
 font-size: 0;
 text-decoration: none;
 text-indent: -999px;
 background-color: transparent;
 background-image: url('../images/icons/icons.png');
}</pre>
<p>Now to turn any element into an icon you need add the <code>icon</code> class and one of the classes from the <code>icons.css</code> file. Like this:</p>
<pre class="brush: xml;">&lt;span class=&quot;icon icon-application-delete&quot; title=&quot;Delete&quot;&gt;Delete&lt;/span&gt;</pre>
<p>You can turn any element into an icon: a <code>span</code>, a <code>div</code>, an <code>anchor</code> even a form <code>input</code> or <code>button</code>.</p>
<pre class="brush: xml;">&lt;span class=&quot;icon icon-hourglass-add&quot;&gt;Add&lt;/span&gt;
&lt;button type=&quot;button&quot; class=&quot;icon icon-hourglass-add&quot;&gt;Add&lt;/button&gt;
&lt;input type=&quot;submit&quot; class=&quot;icon icon-hourglass-add&quot; value=&quot;Add&quot; /&gt;</pre>
<p>Although the tags are different they will all look the same:</p>
<p><a href="http://slicer.dev/wp-content/uploads/2010/07/icons-hourglass.gif"><img class="alignnone size-full wp-image-300" title="icons-hourglass" src="http://slicer.dev/wp-content/uploads/2010/07/icons-hourglass.gif" alt="" width="78" height="23" /></a></p>
<p>I&#8217;ve also included desaturated version of the sprite, for inactive icons. To make an icon inactive simply swap the <code>icon</code> class with <code>icon-disabled</code>. Like this:</p>
<pre class="brush: xml;">&lt;span class=&quot;icon-disabled icon-hourglass-add&quot;&gt;Add&lt;/span&gt;</pre>
<p>The result should be a greyed out icon. <a href="http://slicer.dev/wp-content/uploads/2010/07/icon-disabled.gif"><img class="alignnone size-full wp-image-305" title="icon-disabled" src="http://slicer.dev/wp-content/uploads/2010/07/icon-disabled.gif" alt="" width="28" height="24" /></a></p>
<p>I&#8217;ve made an icon reference page. To find out what class each icon has, simply hover over it.</p>
<p>Feel free to comment if you have anything to add or if you find something wrong in the article. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sliceratwork.com/famfamfam-css-image-sprites/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome Frame IE update</title>
		<link>http://www.sliceratwork.com/integrate-google-chrome-frame-in-ie</link>
		<comments>http://www.sliceratwork.com/integrate-google-chrome-frame-in-ie#comments</comments>
		<pubDate>Wed, 23 Sep 2009 17:30:40 +0000</pubDate>
		<dc:creator>slicer</dc:creator>
				<category><![CDATA[(X)HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.sliceratwork.com/?p=118</guid>
		<description><![CDATA[On September 22, 2009, Google released an early version of Google Chrome Frame, an open source plug-in that brings HTML5 and other open web technologies to Internet Explorer. What exactly does Google Chrome Frame do? Well it allows you to render web pages in IE using Chrome&#8217;s rendering engine, WebKit. You&#8217;ll be able to use [...]]]></description>
			<content:encoded><![CDATA[<p>On September 22, 2009, Google released an early version of <a rel="nofollow external" href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a>, an open source plug-in that brings HTML5 and other open web technologies to Internet Explorer.</p>
<p>What exactly does <a href="http://www.sliceratwork.com/integrate-google-chrome-frame-in-ie.html">Google Chrome Frame</a> do? Well it allows you to render web pages in <abbr title="Internet Explorer">IE</abbr> using Chrome&#8217;s rendering engine, <a rel="nofollow external" href="http://webkit.org/">WebKit</a>.</p>
<p>You&#8217;ll be able to use HTML5 elements such as canvas, <abbr title="Cascading Style Sheets">CSS</abbr> border-radius and have access to powerful <abbr title="Cascading Style Sheets">CSS</abbr> selectors. Basically you&#8217;ll have all the power of Google Chrome  in <abbr title="Internet Explorer">IE</abbr>. Cool huh?</p>
<p>So how do we use this great tool? Well here&#8217;s the catch: Google Chrome Frame is offered as a plugin.That means <strong>the user has to install it on their <abbr title="Personal Computer">PC</abbr></strong>. You can&#8217;t just add a script tag in your markup and it will magically work.</p>
<p>So we need to make sure that the user installs Google Chrome Frame on their <abbr title="Personal Computer">PC</abbr>. What&#8217;s the best way to do that, I hear you say? Present it as an update of course. <a rel="nofollow external" href="http://ie6update.com/">Inspiration</a> for the idea <img src='http://www.sliceratwork.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<div id="attachment_128" class="wp-caption alignnone" style="width: 585px"><img class="size-full wp-image-128" title="IE required updates" src="http://slicer.dev/wp-content/uploads/2009/09/IE-update.jpg" alt="IE required updates" width="575" height="65" /><p class="wp-caption-text">IE required updates</p></div>
<p>See that yellowish line with the little shield on the left? That&#8217;s called the Information Bar. It displays information about security updates, missing plug-ins and stuff like that.That&#8217;s where we will show our missing plugin message.</p>
<p>I know what you are thinking: <cite>&#8220;Is this ethical? Aren&#8217;t you lying to users ?&#8221;</cite>. Well&#8230;let&#8217;s look at it this way: we want to change the default rendering engine of a browser (<abbr title="Internet Explorer">IE</abbr>&#8216;s Trident), to another one (Google Chrome&#8217;s WebKit)&#8230; so yeah, I consider that an update.</p>
<p>Ok here is where the technical stuff begins. First we need to include a meta tag in the  <code>&lt;head&gt;</code> section of our document.</p>
<pre class="brush: xml;">&amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;chrome=1&amp;quot; /&amp;gt;</pre>
<p>This <code>&lt;meta&gt;</code> tag ensures that users running <abbr title="Internet Explorer">IE</abbr> with Google Chrome Frame installed will see web pages rendered by Google Chrome Frame. Now we just have to worry about those who don&#8217;t have Google Chrome Frame. Easy huh?</p>
<p>We need to detect if a user has Google Chrome Frame installed. And we can do that in 2 ways: server-side detection or JavaScript.We are going to use JavaScript.</p>
<p>We need to include the <code>CFInstall.js</code> file, provided by the nice people at Google.</p>
<pre class="brush: xml;">&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js&amp;quot; charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;</pre>
<p>Next we need to have another <code>script</code> were we will create our Information bar and do all of our configuration.I prefer to call mine <code>config.js</code>. Feel free to name it whatever you want.</p>
<pre class="brush: xml;">&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;scripts/config.js&amp;quot; charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;</pre>
<p>Here is the content of that file:</p>
<pre class="brush: jscript;">//add a class of js to the body tag for CSS purposes
document.getElementsByTagName('html')[0].className += ' js';

//read cookies
function readCookie(name){
    var cookieName = name + &amp;quot;=&amp;quot;;
    var ca = document.cookie.split(';');
    for (var i = 0; i &amp;lt; ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ')
            c = c.substring(1, c.length);
        if (c.indexOf(cookieName) == 0)
            return c.substring(cookieName.length, c.length);
    }
    return null;
};

//we check for when the DOM has loaded and if the user has not closed our Information Bar
document.onreadystatechange = function(){
    if (document.readyState == &amp;quot;complete&amp;quot; &amp;amp;&amp;amp; !readCookie('refuseChromeInstall')) {
        CFInstall.check({
            //disable the default prompting mechanism
            preventPrompt: true,

            //if Google Chrome Frame is missing we execute the folowing function
            onmissing: function(){
                //create the Information Bar
                var updateBar = document.createElement('div');
                updateBar.id = 'updateBar';

                updateBar.onmouseover = function(){
                    this.className = 'over';
                };
                updateBar.onmouseout = function(){
                    this.className = '';
                };

                //when the user clicks on the Information Bar, open a popup with the Google Chrome Frame terms of service page
                updateBar.onclick = function(){
                    window.open('http://www.google.com/chromeframe/eula.html', 'GCFInstall', 'width=760, height=500');
                };

                var updateMessage = document.createElement('div');
                updateMessage.id = 'updateMessage';
                updateMessage.appendChild(document.createTextNode('Internet Explorer is missing updates required to view this site. Click here to update...'));
                updateBar.appendChild(updateMessage);

                var closeUpdateBar = document.createElement('div');
                closeUpdateBar.id = 'closeUpdateBar';
                closeUpdateBar.onclick = function(){
                    //if the user chooses not to install Google Chrome Frame, we set a cookie, so as not to show the Information Bar on every page refresh
                    document.cookie = 'refuseChromeInstall=1';

                    //remove the Information Bar
                    document.getElementsByTagName('body')[0].removeChild(document.getElementById('updateBar'));
                };

                //append the close button to our Information Bar
                updateBar.appendChild(closeUpdateBar);

                //append the Information Bar to our body element
                document.getElementsByTagName('body')[0].appendChild(updateBar);
            }
        });
    }
};</pre>
<p>Now that we have our Information Bar created, we need to give it some <code>&lt;style&gt;</code>;</p>
<pre class="brush: css;">#updateBar {
	width: 100%;
	padding: 5px 0px;
	border-bottom: 1px solid #666;
	position: absolute;
	top: 0px;
	left: 0px;
	z-index: 10000;
	font-family: Bitstream Vera Sans,verdana,sans-serif !important;
	font-size: 11px !important;
	color: #000 !important;
	background: #FFFFE1;
	cursor: default;
}

* html #updateBar {
	position: absolute;
	top:expression(eval(document.compatMode &amp;amp;&amp;amp; document.compatMode=='CSS1Compat') ? documentElement.scrollTop : document.body.scrollTop);
}

#updateBar.over {
	color: #fff !important;
	background: #3399ff;
}

#updateMessage {
	height: 16px;
	line-height: 16px;
	padding: 0px 23px;
	background: url(../images/icons/install-shield.gif) 3px 0px no-repeat;
}

#updateBar.over #updateMessage {
	background-position: 3px -16px;
}

#closeUpdateBar {
	width: 16px;
	height: 16px;
	position: absolute;
	top: 5px;
	right: 1px;
	z-index: 10001;
	background: url(../images/icons/close.gif) 0px 0px;
}

#updateBar.over #closeUpdateBar {
	background-position: 0px -16px;
}</pre>
<p>A quick tour of how things are supposed to work:</p>
<p>When a user that has <a href="http://www.sliceratwork.com/integrate-google-chrome-frame-in-ie.html">Google Chrome Frame</a> installed views the site, everything&#8217;s fine and dandy. They are using the WebKit rendering engine and the page show&#8217;s up nicely. If a user does not have Google Chrome Frame installed, they will be prompted by the Information Bar to install it as an update.</p>
<p>When the user clicks on the Information Bar, a popup window appears with the Google Chrome Frame Terms of Service page and two options: accept and install the plugin or cancel.</p>
<p>If the user chooses not to install Google Chrome Frame, we don&#8217;t want to bug them every time they refresh or leave a page. So when the user clicks the little close button on the right side of the Information bar, the Information Bar will no longer appear. They will be prompted to install the plugin next time they view the website.</p>
<p>Note that the Information Bar will only appear if you view the demo page in <abbr title="Internet Explorer">IE</abbr> and the blue <code>&lt;div/&gt;</code> will only spin in a WebKit based browser or in <abbr title="Internet Explorer">IE</abbr> but after you install Google Chrome Frame.</p>
<p>Here&#8217;s a screenshot of WebKit transitions working in <abbr title="Internet Explorer">IE</abbr>8.</p>
<div id="attachment_181" class="wp-caption alignnone" style="width: 585px"><img class="size-full wp-image-181" title="ie-webkit-transitions" src="http://slicer.dev/wp-content/uploads/2009/09/ie-webkit-transitions.jpg" alt="WebKit transitions working in IE8" width="575" height="250" /><p class="wp-caption-text">WebKit transitions working in IE8</p></div>
<p>You will need to restart your browser after the installation has completed in order to see the effects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sliceratwork.com/integrate-google-chrome-frame-in-ie/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>CSS text shadow</title>
		<link>http://www.sliceratwork.com/css-text-shadow</link>
		<comments>http://www.sliceratwork.com/css-text-shadow#comments</comments>
		<pubDate>Mon, 21 Sep 2009 08:19:49 +0000</pubDate>
		<dc:creator>slicer</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://slicer.dev/?p=471</guid>
		<description><![CDATA[CSS 3 has an interesting text property named text-shadow, which allows you to add a drop shadow to your text.Unfortunately and predictably not all browsers support this property. Today we will see which browsers do support text-shadow and to what extent. Let&#8217;s have a look at the syntax proposed by the W3C: h1 { text-shadow: [...]]]></description>
			<content:encoded><![CDATA[<p><abbr title="Cascading Style Sheet">CSS</abbr> 3 has an interesting text property named <code>text-shadow</code>, which allows you to add a drop shadow to your text.Unfortunately and predictably not all browsers support this property.</p>
<p>Today we will see which browsers do support <code>text-shadow</code> and to what extent.</p>
<p>Let&#8217;s have a look at the syntax proposed by the <abbr title="World Wide Web Consortium">W3C</abbr>:</p>
<pre class="brush: css;">
h1 { text-shadow: 2px 2px 1px #000; }
</pre>
<p>Using the above rule we should get a result similar to the image  below, providing you are viewing the page in a browser that supports <code>text-shadow</code>.</p>
<div>
<dl id="attachment_24">
<dt><img title="CSS text shadow" src="http://slicer.dev/wp-content/uploads/2009/09/css-text-shadow-results.jpg" alt="CSS text shadow" width="304" height="62" /></dt>
<dd>CSS text shadow</dd>
</dl>
</div>
<p>Let&#8217;s examine the rule above.</p>
<pre class="brush: css;">
h1 { text-shadow: top-offset left-offset blur-radius color; }
</pre>
<dl>
<dt>top-offset</dt>
<dd>defines the top offset of the drop shadow.It can be positive, negative or 0 (zero).</dd>
<dt>left-offset</dt>
<dd>defines the left offset of the drop shadow.It can be positive, negative or 0 (zero).</dd>
<dt>blur-radius</dt>
<dd>defines the amount of &#8220;fuzzines&#8221; of the drop shadow</dd>
<dt>color</dt>
<dd>defines the color of the drop shadow</dd>
</dl>
<p>You can change the opacity of the drop shadow by using <code>rgba</code>.</p>
<pre class="brush: css;">
h1 { text-shadow: 2px 2px 1px rgba(255, 0, 0, 0.5); }
</pre>
<div>
<dl id="attachment_94">
<dt><img title="rgba-text-shadow" src="http://slicer.dev/wp-content/uploads/2009/09/rgba-text-shadow.jpg" alt="RGBA text-shadow" width="296" height="119" /></dt>
<dd>RGBA text-shadow.</dd>
</dl>
</div>
<p>You could also add multiple <code>text-shadow</code>s, but the effect might get a little ugly.</p>
<pre class="brush: css;">
h1 {
    text-shadow: 2px 2px 1px #00ff00,
	-2px -2px 1px #ff0000,
	-3px 3px 1px #0000ff;
}
</pre>
<p>The code above produces the following results.Nasty huh?</p>
<div>
<dl id="attachment_60">
<dt><img title="Multiple CSS text-shadows" src="http://slicer.dev/wp-content/uploads/2009/09/multiple-text-shadows.jpg" alt="Multiple CSS text-shadows" width="307" height="53" /></dt>
<dd>Multiple CSS text-shadows</dd>
</dl>
</div>
<p>Of course Microsoft had to do things differently, so let&#8217;s have a look at <abbr title="Internet Explorer">IE</abbr>&#8216;s implementation of <code>text-shadow</code>.</p>
<pre class="brush: css;">
h1 { filter: Shadow(Color=#000000, Direction=135, Strength=3); }
</pre>
<dl>
<dt>Color</dt>
<dd>Sets or retrieves the value of the color applied with the filter.</dd>
<dt>Direction</dt>
<dd>Sets or retrieves the direction that the filter&#8217;s effect is offset.</dd>
<dt>Enabled</dt>
<dd>Sets or retrieves a value that indicates whether the filter is enabled.</dd>
<dt>Strength</dt>
<dd>Sets or retrieves the distance, in pixels, that a filter effect extends.</dd>
</dl>
<p>Excerpt taken from <a rel="nofollow external" href="http://msdn.microsoft.com/en-us/library/ms533086%28VS.85%29.aspx">Internet Explorer Developer Center</a>.</p>
<p>If you add that rule to your <abbr title="Cascading Style Sheet">CSS</abbr> file, you may find it doesn&#8217;t do anything, that&#8217;s because the element you are targeting, in this case the <code>h1</code> tag, needs to have another &#8220;Microsoft magical property&#8221;, named <a rel="nofollow external" href="http://msdn.microsoft.com/en-us/library/ms530764%28VS.85%29.aspx">hasLayout</a>.</p>
<p>Here is how your <code>h1</code> tag, should look in <abbr title="Internet Explorer">IE</abbr>.</p>
<div>
<dl id="attachment_32">
<dt><img title="Text-shadow in IE" src="http://slicer.dev/wp-content/uploads/2009/09/ie-text-shadow.jpg" alt="Text-shadow in IE" width="304" height="58" /></dt>
<dd>Text-shadow in IE</dd>
</dl>
</div>
<p>As you can see <abbr title="Internet Explorer">IE</abbr>&#8216;s way of rendering <code>text-shadow</code> is not that nice.<abbr title="Internet Explorer">IE</abbr>&#8216;s filters do not allow for the same effects as the <abbr title="World Wide Web Consortium">W3C</abbr>&#8216;s implementation of <code>text-shadow</code> like multiple shadows for example and also the font is a bit jagged.</p>
<p>So here is the final code:</p>
<pre class="brush: css;">
h1 {
    text-shadow: 2px 2px 1px #000; /* used for standard compliant browsers */
    filter: Shadow(Color=#000000, Direction=135, Strength=3); /* used for IE */
    zoom: 1.0; /* used to ensure that the element hasLayout */
}
</pre>
<p>Below is a list of browsers that support <code>text-shadow</code>:</p>
<ul>
<li>Firefox 3.5: supports <code>text-shadow</code>, <code>rgba</code> on <code>text-shadow</code> and multiple <code>text-shadow</code>s</li>
<li>Safari 3: supports <code>text-shadow</code>, <code>rgba</code> on <code>text-shadow</code>.has some bugs rendering multiple shadows</li>
<li>Google Chrome 3: supports <code>text-shadow</code>, <code>rgba</code> on <code>text-shadow</code> and multiple <code>text-shadow</code>s</li>
<li>Opera 9: supports <code>text-shadow</code>, and multiple <code>text-shadow</code>s</li>
<li>Opera 10:  supports <code>text-shadow</code>, <code>rgba</code> on <code>text-shadow</code> and multiple <code>text-shadow</code>s</li>
<li> <abbr title="Internet Explorer">IE</abbr>5.5 −&gt; 8: supports a poor implementation of the <code>text-shadow</code> property</li>
<li>Konqueror: not tested.</li>
<li>iCab: not tested.</li>
</ul>
<p><img title="Cross-browser text-shadow" src="http://slicer.dev/wp-content/uploads/2009/09/cross-browser-text-shadow.jpg" alt="Cross-browser text-shadow" width="576" height="360" /></p>
<p>If you need your text to have a consistent drop shadow effect,  regardless of the browser it&#8217;s viewed in, you should consider a font  replacing technique such as <a rel="nowfollow external" href="http://cufon.shoqolate.com/generate/">cufón</a>, or the oldy but goldy <a rel="nowfollow external" href="http://novemberborn.net/sifr3">sIFR</a>.</p>
<p>There might be other browsers that support <code>text-shadow</code>, if you find them please let me know and I&#8217;ll add them to the list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sliceratwork.com/css-text-shadow/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
