<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: RobLab &#8211; How to find out the Text Size setting in IE</title>
	<atom:link href="http://robertnyman.com/2005/07/14/roblab-how-to-find-out-the-text-size-setting-in-an-ie-web-browser/feed/" rel="self" type="application/rss+xml" />
	<link>http://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>
	<lastBuildDate>Wed, 17 Mar 2010 21:34:04 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Richard Lee</title>
		<link>http://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 isPermaLink="false">http://www.robertnyman.com/?p=118#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(&quot;optStores&quot;);
    var intOffsetHeight = objStoreList.offsetHeight;    
    var intNoRows       = objStoreList.size;
    var intRatio        = intOffsetHeight/intNoRows;
    
    var strTextSizeSetting;
    if (intRatio &gt; 20)
    {
      strTextSizeSetting = &quot;Largest&quot;;
      objStoreList.size=13;
    }
    else if (intRatio &gt; 18)
    {
      strTextSizeSetting = &quot;Larger&quot;;
      objStoreList.size=14;
    }
    else if (intRatio &gt; 16)
    {
      strTextSizeSetting = &quot;Medium&quot;;
      objStoreList.size=16;
    }
    else if (intRatio &gt; 13)
    {
      strTextSizeSetting = &quot;Smaller&quot;;
      objStoreList.size=20;
    }
    else
    {
      strTextSizeSetting = &quot;smallest&quot;;
      objStoreList.size=22;
    }
    
    var strAlertText = &quot;Your text setting is &quot; + strTextSizeSetting + &quot; offset was &quot; + intOffsetHeight + &quot; and no rows was &quot; + intNoRows   + &quot; so intRatio was &quot; +  intRatio;   
    alert(strAlertText);

}
&lt;/code&gt;

I&#039;m coding using em (obviously) but I&#039;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 &#8211; 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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#comment-2573</guid>
		<description>Eric,

Very interesting question. I&#039;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://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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#comment-2569</guid>
		<description>Hi

How is this affected by Windows&#039; Dots-per-inch setting ?

&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/highdpi.asp&quot; rel=&quot;nofollow&quot;&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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#comment-708</guid>
		<description>Mark,

Ha ha! Yes, I do. :-)
But that would&#039;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&#039;t that experienced in JavaScript</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>Ha ha! Yes, I do. <img src='http://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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#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://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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#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&#039;s not just an &lt;acronym title=&quot;Internet Explorer&quot;&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 IE hack?).</p></blockquote>
<p>No, it&#8217;s not just an <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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#comment-689</guid>
		<description>A related tip to remember: Similar to &lt;a href=&quot;http://www.robertnyman.com/2005/07/15/the-most-important-css-rule/&quot; rel=&quot;nofollow&quot;&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 CSS rule</a>, setting body{font-size: 100%} helps to normalize relative font sizes throughout the page and across browsers (or is this just an IE hack?).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nyman</title>
		<link>http://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 isPermaLink="false">http://www.robertnyman.com/?p=118#comment-665</guid>
		<description>Dimitri,

The &lt;code&gt;onresize&lt;/code&gt; event is indeed triggered in &lt;acronym title=&quot;Internet Explorer&quot;&gt;IE&lt;/acronym&gt; 6 (but not in the 5.x versions). However, Firefox doesn&#039;t trigger the event either.

Your and Shaun&#039;s script does work in those versions and web browsers where the event isn&#039;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">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://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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#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&#039;s the &quot;cool&quot; 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://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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#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&#039;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&#039;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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#comment-660</guid>
		<description>You&#039;ve got to check out Shaun Inman&#039;s &quot;clear absolutes&quot; 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&#039;s old, and I can&#039;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 (<a href="http://www.shauninman.com/plete/2004/07/absolutely-positive" rel="nofollow">http://www.shauninman.com/plete/2004/07/absolutely-positive</a>). 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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#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://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://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 isPermaLink="false">http://www.robertnyman.com/?p=118#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://robertnyman.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
