<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: RobLab - How to find out the Text Size setting in IE</title>
	<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/</link>
	<description>Web development and Internet trends</description>
	<pubDate>Sun, 27 Jul 2008 08:01:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3</generator>
		<item>
		<title>By: Richard Lee</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-5621</link>
		<dc:creator>Richard Lee</dc:creator>
		<pubDate>Thu, 22 Jun 2006 12:39:05 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-5621</guid>
		<description>Hi, I use a similar snippet to resize the amount of rows in a seslect box based on the text size setting.

I changed it a little so it followed the same coding style as you have used above...
&lt;code&gt;
function checkFontSize()
{ 
    var objStoreList    = document.getElementById("optStores");
    var intOffsetHeight = objStoreList.offsetHeight;    
    var intNoRows       = objStoreList.size;
    var intRatio        = intOffsetHeight/intNoRows;
    
    var strTextSizeSetting;
    if (intRatio &#62; 20)
    {
      strTextSizeSetting = "Largest";
      objStoreList.size=13;
    }
    else if (intRatio &#62; 18)
    {
      strTextSizeSetting = "Larger";
      objStoreList.size=14;
    }
    else if (intRatio &#62; 16)
    {
      strTextSizeSetting = "Medium";
      objStoreList.size=16;
    }
    else if (intRatio &#62; 13)
    {
      strTextSizeSetting = "Smaller";
      objStoreList.size=20;
    }
    else
    {
      strTextSizeSetting = "smallest";
      objStoreList.size=22;
    }
    
    var strAlertText = "Your text setting is " + strTextSizeSetting + " offset was " + intOffsetHeight + " and no rows was " + intNoRows   + " so intRatio was " +  intRatio;   
    alert(strAlertText);

}
&lt;/code&gt;

I'm coding using em (obviously) but I'm also using font-size of 79% rather than 100% as part of the standards here - so may have to check the values in the IF Elses

Cheers</description>
		<content:encoded><![CDATA[<p>Hi, I use a similar snippet to resize the amount of rows in a seslect box based on the text size setting.</p>
<p>I changed it a little so it followed the same coding style as you have used above&#8230;<br />
<code><br />
function checkFontSize()<br />
{<br />
    var objStoreList    = document.getElementById("optStores");<br />
    var intOffsetHeight = objStoreList.offsetHeight;<br />
    var intNoRows       = objStoreList.size;<br />
    var intRatio        = intOffsetHeight/intNoRows;</p>
<p>    var strTextSizeSetting;<br />
    if (intRatio &gt; 20)<br />
    {<br />
      strTextSizeSetting = "Largest";<br />
      objStoreList.size=13;<br />
    }<br />
    else if (intRatio &gt; 18)<br />
    {<br />
      strTextSizeSetting = "Larger";<br />
      objStoreList.size=14;<br />
    }<br />
    else if (intRatio &gt; 16)<br />
    {<br />
      strTextSizeSetting = "Medium";<br />
      objStoreList.size=16;<br />
    }<br />
    else if (intRatio &gt; 13)<br />
    {<br />
      strTextSizeSetting = "Smaller";<br />
      objStoreList.size=20;<br />
    }<br />
    else<br />
    {<br />
      strTextSizeSetting = "smallest";<br />
      objStoreList.size=22;<br />
    }</p>
<p>    var strAlertText = "Your text setting is " + strTextSizeSetting + " offset was " + intOffsetHeight + " and no rows was " + intNoRows   + " so intRatio was " +  intRatio;<br />
    alert(strAlertText);</p>
<p>}<br />
</code></p>
<p>I&#8217;m coding using em (obviously) but I&#8217;m also using font-size of 79% rather than 100% as part of the standards here - so may have to check the values in the IF Elses</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-2573</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 11 Jan 2006 19:12:42 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-2573</guid>
		<description>Eric,

Very interesting question. I'm going to be honest here: I have no idea! :-)

But please feel free to test it!</description>
		<content:encoded><![CDATA[<p>Eric,</p>
<p>Very interesting question. I&#8217;m going to be honest here: I have no idea! <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>But please feel free to test it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Drummond</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-2569</link>
		<dc:creator>Eric Drummond</dc:creator>
		<pubDate>Wed, 11 Jan 2006 17:22:46 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-2569</guid>
		<description>Hi

How is this affected by Windows' Dots-per-inch setting ?

&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/highdpi.asp" rel="nofollow"&gt;Adjusting Scale for Higher DPI Screens&lt;/a&gt;

Eric</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>How is this affected by Windows&#8217; Dots-per-inch setting ?</p>
<p><a href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/highdpi.asp" rel="nofollow">Adjusting Scale for Higher DPI Screens</a></p>
<p>Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-708</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Wed, 20 Jul 2005 14:24:22 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-708</guid>
		<description>Mark,

Ha ha! Yes, I do. :-)
But that would've resulted in more lines in the code (with using &lt;code&gt;break:&lt;/code&gt; for each option).

Besides, I thought it would be easier to understand with &lt;code&gt;if&lt;/code&gt; clauses for those that aren't that experienced in JavaScript</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>Ha ha! Yes, I do. <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
But that would&#8217;ve resulted in more lines in the code (with using <code>break:</code> for each option).</p>
<p>Besides, I thought it would be easier to understand with <code>if</code> clauses for those that aren&#8217;t that experienced in JavaScript</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Wubben</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-707</link>
		<dc:creator>Mark Wubben</dc:creator>
		<pubDate>Wed, 20 Jul 2005 13:55:29 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-707</guid>
		<description>Robert, you know &lt;code&gt;switch()&lt;/code&gt; exists in JavaScript, right? ;-)</description>
		<content:encoded><![CDATA[<p>Robert, you know <code>switch()</code> exists in JavaScript, right? <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-692</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Mon, 18 Jul 2005 20:59:25 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-692</guid>
		<description>J.J.,
&lt;blockquote&gt;...setting body{font-size: 100%} helps to normalize relative font sizes throughout the page and across browsers (or is this just an IE hack?).&lt;/blockquote&gt;

No, it's not just an &lt;acronym title="Internet Explorer"&gt;IE&lt;/acronym&gt; hack, I find it to be very consistent and I constantly use it in my solutions.</description>
		<content:encoded><![CDATA[<p>J.J.,</p>
<blockquote><p>&#8230;setting body{font-size: 100%} helps to normalize relative font sizes throughout the page and across browsers (or is this just an <acronym title="Internet Explorer">IE</acronym> hack?).</p></blockquote>
<p>No, it&#8217;s not just an <acronym title="Internet Explorer"></acronym><acronym title="Internet Explorer">IE</acronym> hack, I find it to be very consistent and I constantly use it in my solutions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. J.</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-689</link>
		<dc:creator>J. J.</dc:creator>
		<pubDate>Mon, 18 Jul 2005 20:10:33 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-689</guid>
		<description>A related tip to remember: Similar to &lt;a href="http://www.robertnyman.com/2005/07/15/the-most-important-css-rule/" rel="nofollow"&gt;The most important CSS rule&lt;/a&gt;, setting body{font-size: 100%} helps to normalize relative font sizes throughout the page and across browsers (or is this just an IE hack?).</description>
		<content:encoded><![CDATA[<p>A related tip to remember: Similar to <a href="http://www.robertnyman.com/2005/07/15/the-most-important-css-rule/" rel="nofollow">The most important <acronym title="Cascading Style Sheets">CSS</acronym> rule</a>, setting body{font-size: 100%} helps to normalize relative font sizes throughout the page and across browsers (or is this just an <acronym title="Internet Explorer">IE</acronym> hack?).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-665</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Fri, 15 Jul 2005 13:00:29 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-665</guid>
		<description>Dimitri,

The &lt;code&gt;onresize&lt;/code&gt; event is indeed triggered in &lt;acronym title="Internet Explorer"&gt;IE&lt;/acronym&gt; 6 (but not in the 5.x versions). However, Firefox doesn't trigger the event either.

Your and Shaun's script does work in those versions and web browsers where the event isn't triggered, so that is cool!  :-)</description>
		<content:encoded><![CDATA[<p>Dimitri,</p>
<p>The <code>onresize</code> event is indeed triggered in <acronym title="Internet Explorer"></acronym><acronym title="Internet Explorer">IE</acronym> 6 (but not in the 5.x versions). However, Firefox doesn&#8217;t trigger the event either.</p>
<p>Your and Shaun&#8217;s script does work in those versions and web browsers where the event isn&#8217;t triggered, so that is cool!  <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitri Glazkov</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-664</link>
		<dc:creator>Dimitri Glazkov</dc:creator>
		<pubDate>Fri, 15 Jul 2005 12:41:22 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-664</guid>
		<description>One of the issues that Shaun (and I) had to deal with is the fact that &lt;code&gt;onresize&lt;/code&gt; is not called when you change the font size in the browser. That's the "cool" part that I was trying to point out :)</description>
		<content:encoded><![CDATA[<p>One of the issues that Shaun (and I) had to deal with is the fact that <code>onresize</code> is not called when you change the font size in the browser. That&#8217;s the &#8220;cool&#8221; part that I was trying to point out <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-661</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Thu, 14 Jul 2005 13:04:43 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-661</guid>
		<description>Dimitri,

Thanks for the tip, interesting!

I tested the code and just glanced at it, and it seemed pretty cool. However, if it's a large page with lots of elements, it might be a performance issue to loop trough all of it.

In my example, you can add the function call to the &lt;code&gt;onresize&lt;/code&gt; event to (to get the on-the-fly functionality), and if you find out that the Text Size setting isn't optimal, you just load an extra style sheet altering the text size to a more desirable look.</description>
		<content:encoded><![CDATA[<p>Dimitri,</p>
<p>Thanks for the tip, interesting!</p>
<p>I tested the code and just glanced at it, and it seemed pretty cool. However, if it&#8217;s a large page with lots of elements, it might be a performance issue to loop trough all of it.</p>
<p>In my example, you can add the function call to the <code>onresize</code> event to (to get the on-the-fly functionality), and if you find out that the Text Size setting isn&#8217;t optimal, you just load an extra style sheet altering the text size to a more desirable look.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitri Glazkov</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-660</link>
		<dc:creator>Dimitri Glazkov</dc:creator>
		<pubDate>Thu, 14 Jul 2005 12:36:19 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-660</guid>
		<description>You've got to check out Shaun Inman's "clear absolutes" solution (http://www.shauninman.com/plete/2004/07/absolutely-positive). He implements dynamic sensing of the font size, i.e. determining font size change on-the-fly. It's old, and I can't vouch for the quality of code anymore, but the technique is still fairly cool.</description>
		<content:encoded><![CDATA[<p>You&#8217;ve got to check out Shaun Inman&#8217;s &#8220;clear absolutes&#8221; solution (http://www.shauninman.com/plete/2004/07/absolutely-positive). He implements dynamic sensing of the font size, i.e. determining font size change on-the-fly. It&#8217;s old, and I can&#8217;t vouch for the quality of code anymore, but the technique is still fairly cool.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-659</link>
		<dc:creator>Robert Nyman</dc:creator>
		<pubDate>Thu, 14 Jul 2005 12:34:44 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-659</guid>
		<description>Faruk,

Thank you!
Apparently it has been pretty appreciated.  :-)</description>
		<content:encoded><![CDATA[<p>Faruk,</p>
<p>Thank you!<br />
Apparently it has been pretty appreciated.  <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Faruk AteÅŸ</title>
		<link>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-658</link>
		<dc:creator>Faruk AteÅŸ</dc:creator>
		<pubDate>Thu, 14 Jul 2005 12:33:40 +0000</pubDate>
		<guid>http://www.robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/#comment-658</guid>
		<description>This is very, very useful. Good job! :-)</description>
		<content:encoded><![CDATA[<p>This is very, very useful. Good job! <img src='http://www.robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
