<?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>johnmu.com &#187; Usability</title>
	<atom:link href="http://johnmu.com/category/usability/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnmu.com</link>
	<description>John Mueller's technical website tips and tricks</description>
	<lastBuildDate>Thu, 03 Dec 2009 12:42:37 +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>Adding text resizing with cookie</title>
		<link>http://johnmu.com/adding-text-resizing/</link>
		<comments>http://johnmu.com/adding-text-resizing/#comments</comments>
		<pubDate>Mon, 16 Jul 2007 11:19:40 +0000</pubDate>
		<dc:creator>John Mueller</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://johnmu.com/adding-text-resizing/</guid>
		<description><![CDATA[In the top right corner of this blog I have placed a small set of links that let you resize the text as it is displayed. It's easy to use this script on your blog and it lets your visitors resize the text on the blog however they want it. The resizing setting is stored [...]]]></description>
			<content:encoded><![CDATA[<p>In the top right corner of this blog I have placed a small set of links that let you resize the text as it is displayed. It's easy to use this script on your blog and it lets your visitors resize the text on the blog however they want it. The resizing setting is stored in a cookie, valid for one year, so when the visitor returns, they will see the site as they resized it last.<br />
<span id="more-68"></span><br />
To add the script you only have to copy one file into your theme folder and add a line of javascript into your theme in an appropriate location. It might look like a lot of steps here, but you'll see that it's fairly simple. </p>
<ol>
<li><strong>Make a backup</strong>
<p>Before you change anything, always make a backup of your theme files and perhaps even of your full Wordpress installation. It never hurts to have too many backups <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
</li>
<li><strong>Download the script</strong>
<p>Download the file <a href="http://johnmu.com/files/textresize.js" target="_blank">textresize.js</a> from here. Put it on your desktop or someplace where you can find it.
</li>
<li><strong>Check your Wordpress theme</strong>
<p>You might be able to skip this step, depending on how your Wordpress theme is made. Open your blog in your browser, use "View Source" and take a quick look at the source code (not too long, it could make your head spin). You should find a section pretty much on top which "wraps" your whole site in a "DIV" element. Often it will be called "wrapper", "content" or "container". It will look something like this:</p>
<div class="igBar"><span id="lhtml-7"><a href="#" onclick="javascript:showPlainTxt('html-7'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-7">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"wrapper"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-7--></p>
<p>If you find multiple names that you believe could be the main elements, you might want to try them separately to see which one works best. The default in the code is "wrapper".
</li>
<li><strong>Update the script to match your theme</strong>
<p>If your theme does not use "wrapper" as the ID of the main element, you will need to adjust the javascript file. Don't worry, it's not painful <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Open your copy of "textresize.js" in a text editor like Notepad. You will find the following line near the top:</p>
<div class="igBar"><span id="ljavascript-8"><a href="#" onclick="javascript:showPlainTxt('javascript-8'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-8">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> ts_styleElement=<span style="color: #3366CC;">"#wrapper"</span>; <span style="color: #009900; font-style: italic;">// the ID of the content DIV that you want to resize </span></div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- javascript-8--></p>
<p>Change that line to match your main element, eg:</p>
<div class="igBar"><span id="ljavascript-9"><a href="#" onclick="javascript:showPlainTxt('javascript-9'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-9">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> ts_styleElement=<span style="color: #3366CC;">"#content"</span>; <span style="color: #009900; font-style: italic;">// the ID of the content DIV that you want to resize </span></div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- javascript-9--></p>
<p>Save the file before a cat walks across your keyboard. </p>
</li>
<li><strong>Upload the script to your server</strong>
<p>Copy the modified file onto your server into the current theme folder.
</li>
<li><strong>Update your theme files</strong>
<p>Add the following to your <strong>header.php</strong> in the bottom of the "head" section:</p>
<div class="igBar"><span id="lhtml-10"><a href="#" onclick="javascript:showPlainTxt('html-10'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-10">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;<span style="color: #000066;">src</span>=<span style="color: #ff0000;">"&lt;?php bloginfo('stylesheet_directory'); ?&gt;</span>/textresize.js&quot; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;type=&quot;text/javascript&quot;&gt;<span style="color: #009900;">&lt;/script&gt;</span> </span></div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-10--></p>
<p>Now add the following wherever you wish to see the resize links:</p>
<div class="igBar"><span id="lhtml-11"><a href="#" onclick="javascript:showPlainTxt('html-11'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-11">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!--</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; showReadabilityMenu('Resize text:');</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">&nbsp; &nbsp; //--&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- html-11--></p>
<p>I have placed this in my <strong>header.php</strong>, right after the "searchform" include.
</li>
<li><strong>Optionally add more styling</strong>
<p>You can style the line with changes to your CSS file, eg: </p>
<div class="igBar"><span id="lcss-12"><a href="#" onclick="javascript:showPlainTxt('css-12'); return false;">Select code</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-12">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#header <span style="color: #cc00cc;">#fontsizemenu </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-top</span>: 2px;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p><!-- css-12--><br />
This will depend on your theme and on what you want to do to integrate the links.
</li>
<li><strong>Test, test, test </strong> <img src='http://johnmu.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
<p>Be sure to test the new functionality in the major browsers. I have tested the code in IE 6.5, IE 7.0, Firefox 2.0 and Opera 9.0. The code depends on javascript. With javascript turned off, the user will not see anything.
</li>
</ol>
<p>Have fun!</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://johnmu.com">johnmu.com</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact johnmu.com so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>]]></content:encoded>
			<wfw:commentRss>http://johnmu.com/adding-text-resizing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.352 seconds -->
