<?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>Ersin Acar &#187; style</title>
	<atom:link href="http://ersinacar.com/tag/style/feed" rel="self" type="application/rss+xml" />
	<link>http://ersinacar.com</link>
	<description>PHP and Web Technologies Freak</description>
	<lastBuildDate>Fri, 14 May 2010 11:57:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Javascript CSS style changer</title>
		<link>http://ersinacar.com/javascript-css-style-changer_85.html</link>
		<comments>http://ersinacar.com/javascript-css-style-changer_85.html#comments</comments>
		<pubDate>Wed, 22 Apr 2009 19:49:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[changer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://ersinacar.com/?p=85</guid>
		<description><![CDATA[It may be useful sometimes to provide your visitors with the option to change the appearance of your website. Perhaps you may want to provide theme support for your site. Or you may simply want to provide a bigger font size version of your site for older users who may not be able to read [...]]]></description>
			<content:encoded><![CDATA[<p>It may be useful sometimes to provide your visitors with the option to change the appearance of your website. Perhaps you may want to provide theme support for your site. Or you may simply want to provide a bigger font size version of your site for older users who may not be able to read the small-sized text you use by default. This article describes how you can use JavaScript to dynamically change the cascading style sheets, or CSS, of your website.</p>
<p>Here we go;<br />
<span id="more-85"></span><br />
1st put your css files in ./css directory like</p>
<p>./css/theme1.css</p>
<p>./css/theme2.css</p>
<p>./css/theme3.css</p>
<p>Then put below code in your head tag.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
   <span style="color: #003366; font-weight: bold;">var</span> StyleFile <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;theme&quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">charAt</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">6</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;.css&quot;</span><span style="color: #339933;">;</span>
&nbsp;
   document.<span style="color: #660066;">writeln</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/'</span> <span style="color: #339933;">+</span> StyleFile <span style="color: #339933;">+</span> <span style="color: #3366CC;">'&quot;&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>After that u can make style changer buttons</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">      &lt;div id=&quot;styleswitcher&quot;&gt;
            &lt;ul&gt;
                &lt;li&gt;&lt;a href=&quot;javascript: document.cookie='theme='; window.location.reload();&quot; title=&quot;Default&quot; id=&quot;defswitch&quot;&gt;d&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;javascript: document.cookie='theme=1;'; document.cookie='theme=1; path=/;'; window.location.reload();&quot; title=&quot;Blue&quot; id=&quot;blueswitch&quot;&gt;b&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;javascript: document.cookie='theme=2'; document.cookie='theme=2; path=/;'; window.location.reload();&quot; title=&quot;Green&quot; id=&quot;greenswitch&quot;&gt;g&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;javascript: document.cookie='theme=3'; document.cookie='theme=3; path=/;'; window.location.reload();&quot; title=&quot;Brown&quot; id=&quot;brownswitch&quot;&gt;b&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ersinacar.com/javascript-css-style-changer_85.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
