<?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>Ajax Tutorial &#187; JavaScript</title>
	<atom:link href="http://tutorialajax.com/web/javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://tutorialajax.com</link>
	<description>Prototype, jQuery and another Ajax tutorials</description>
	<lastBuildDate>Tue, 11 Nov 2008 14:24:46 +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>Font Zoomer JavaScript</title>
		<link>http://tutorialajax.com/font-zoomer-javascript.html</link>
		<comments>http://tutorialajax.com/font-zoomer-javascript.html#comments</comments>
		<pubDate>Tue, 04 Nov 2008 14:09:52 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://tutorialajax.com/?p=24</guid>
		<description><![CDATA[This idea come from the Wordpress Zoom Box Plugin. It&#8217;s a widget used to change websites font automatically. This simple widget is easy to made and useful for blog / website. This is how to do it:
Adding the Zoom Box
First of all, add a &#60;Div&#62; to make a zoom-box right after &#60;BODY&#62;

&#60;div id="zoom-box"&#62;
&#60;p id="zoom-title"&#62;&#60;a href="http://thesky.asia/zoom-box/"&#62;ZoomBox&#60;/a&#62;&#60;/p&#62;
&#60;p [...]


Related posts:<ol><li><a href='http://tutorialajax.com/the-prototype-function.html' rel='bookmark' title='Permanent Link: The Prototype $() function'>The Prototype $() function</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This idea come from the <a href="http://thesky.asia/zoom-box/">Wordpress Zoom Box Plugin</a>. It&#8217;s a widget used to change websites font automatically. This simple widget is easy to made and useful for blog / website. This is how to do it:</p>
<h3>Adding the Zoom Box</h3>
<p>First of all, add a <strong>&lt;Div&gt;</strong> to make a zoom-box right after <strong>&lt;BODY&gt;</strong><br />
<code><br />
&lt;div id="zoom-box"&gt;<br />
&lt;p id="zoom-title"&gt;&lt;a href="http://thesky.asia/zoom-box/"&gt;ZoomBox&lt;/a&gt;&lt;/p&gt;<br />
&lt;p id="zoom-control"&gt;<br />
&lt;a href="#" id="zoom-in"&gt;-&lt;/a&gt;<br />
&lt;span id="zoom-text"&gt;10&lt;/span&gt;<br />
&lt;a href="#" id="zoom-out"&gt;+&lt;/a&gt;<br />
&lt;/p&gt;<br />
&lt;/div&gt;</code><br />
<span id="more-24"></span></p>
<h3>Floating and Styling the Zoom Box</h3>
<p>Make the zoom-box <strong>floating as a layer</strong>. so, the it won&#8217;t interfere the existing layout. This step can be done by <strong>css</strong>. Setting the box position to absolute and then use the css to dress up the zoom box whatever you like. For example, this is my css code:</p>
<p><code><br />
&lt;style type="text/css"&gt;<br />
#zoom-box {<br />
position: absolute;<br />
top: 10px;<br />
right: 10px;<br />
background-color:#aaa;<br />
border: 1px solid #000;<br />
}<br />
#zoom-box * {<br />
text-align:center;<br />
font-size: 9pt;<br />
margin: 0;<br />
padding: 0;<br />
text-decoration: none;<br />
height: 20px;<br />
}<br />
#zoom-control * {<br />
float: left;<br />
display: block;<br />
width: 25px;<br />
background-color:#FFFFFF;<br />
}<br />
#zoom-control a {<br />
background-color:#CCC;<br />
}<br />
#zoom-control a:hover {<br />
background-color: #333333;<br />
color: #FFFFFF;<br />
}<br />
&lt;/style&gt;<br />
</code></p>
<h3>Zoom Box Scripting</h3>
<p>With above two steps, we&#8217;ve got a simple zoom-box widget. But it won&#8217;t work yet. To get our zoom-box works, we can use <strong>javascript</strong> like this:</p>
<p><code><br />
&lt;script language="javascript"&gt;<br />
window.onload = function () {<br />
var iFontSize = 1;<br />
document.getElementById("zoom-in").onclick = function () {<br />
iFontSize -= 0.1;<br />
document.body.style.fontSize = iFontSize + "em";<br />
document.getElementById("zoom-text").innerHTML = Math.round( iFontSize * 10 );<br />
}<br />
document.getElementById("zoom-out").onclick = function () {<br />
iFontSize += 0.1;<br />
document.body.style.fontSize = iFontSize + "em";<br />
document.getElementById("zoom-text").innerHTML = Math.round( iFontSize * 10 );<br />
}<br />
}<br />
&lt;/script&gt;<br />
</code></p>
<p>That must works now. If it won&#8217;t work, please recheck your HTML / XHTML. Maybe it&#8217;s not valid or the page&#8217;s structure is broken. Please fix it and try again.</p>


<p>Related posts:<ol><li><a href='http://tutorialajax.com/the-prototype-function.html' rel='bookmark' title='Permanent Link: The Prototype $() function'>The Prototype $() function</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://tutorialajax.com/font-zoomer-javascript.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

