<?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: jQuery plugin: &#8216;autoResize&#8217;</title>
	<atom:link href="http://james.padolsey.com/javascript/jquery-plugin-autoresize/feed/" rel="self" type="application/rss+xml" />
	<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 08 Mar 2010 01:21:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Christian</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-24955</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Tue, 24 Nov 2009 17:23:34 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-24955</guid>
		<description>@Lex - I had the same problem but got around it by calling
&lt;code&gt;
    $(this).keydown();
&lt;/code&gt;

Immediately after calling:
&lt;code&gt;
    $(this).autoResize();
&lt;/code&gt;

In the calling javascript. This simulates a keypress in the box which triggers the auto-resize.

To clarify, I set up the auto-resize with the following code:

&lt;code&gt;
$(document).ready(function(){
  $(&#039;.myclass textarea&#039;).each(function() {
    $(this).autoResize();
    $(this).keydown();
  });
});
&lt;/code&gt;

Christian</description>
		<content:encoded><![CDATA[<p>@Lex &#8211; I had the same problem but got around it by calling<br />
<code><br />
    $(this).keydown();<br />
</code></p>
<p>Immediately after calling:<br />
<code><br />
    $(this).autoResize();<br />
</code></p>
<p>In the calling javascript. This simulates a keypress in the box which triggers the auto-resize.</p>
<p>To clarify, I set up the auto-resize with the following code:</p>
<p><code><br />
$(document).ready(function(){<br />
  $('.myclass textarea').each(function() {<br />
    $(this).autoResize();<br />
    $(this).keydown();<br />
  });<br />
});<br />
</code></p>
<p>Christian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: June Oh</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-24942</link>
		<dc:creator>June Oh</dc:creator>
		<pubDate>Tue, 24 Nov 2009 13:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-24942</guid>
		<description>Thanks for the great plugin!

Unfortunately I&#039;ve found a hole for people who have web standards in mind; defining ROWS &amp; COLS doesn&#039;t affect HEIGHT of the TEXTAREA, but it does affect the SCROLLTOP() value, causing unexpected height changes on this plugin. ROWS &amp; COLS attributes are are required on TEXTAREAs according to W3C standards, whereas the demo TEXTAREA here don&#039;t specify these attributes.

For instance if ROWS=&quot;100&quot; were to be declared with this plugin in use, the SCROLLTOP() value returns LINE-HEIGHT*100ROWS, even if there&#039;s no input at all.

So to solve this problem, I added

$(this).removeAttr(&#039;rows&#039;).removeAttr(&#039;cols&#039;);

before

// Get rid of scrollbars and disable WebKit resizing:
var textarea = $(this).css({resize:&#039;none&#039;,&#039;overflow-y&#039;:&#039;hidden&#039;}),

to delete ROWS &amp; COLS attributes if the plugin is loaded correctly.
This will make the markup pass the W3C standards by leaving out the ROWS &amp; COLS attributes for clients who don&#039;t have Javascript enabled, and at the same time stop the ROWS &amp; COLS attributes from affecting the SCROLLTOP value if the plugin works correctly.</description>
		<content:encoded><![CDATA[<p>Thanks for the great plugin!</p>
<p>Unfortunately I&#8217;ve found a hole for people who have web standards in mind; defining ROWS &amp; COLS doesn&#8217;t affect HEIGHT of the TEXTAREA, but it does affect the SCROLLTOP() value, causing unexpected height changes on this plugin. ROWS &amp; COLS attributes are are required on TEXTAREAs according to W3C standards, whereas the demo TEXTAREA here don&#8217;t specify these attributes.</p>
<p>For instance if ROWS=&#8221;100&#8243; were to be declared with this plugin in use, the SCROLLTOP() value returns LINE-HEIGHT*100ROWS, even if there&#8217;s no input at all.</p>
<p>So to solve this problem, I added</p>
<p>$(this).removeAttr(&#8216;rows&#8217;).removeAttr(&#8216;cols&#8217;);</p>
<p>before</p>
<p>// Get rid of scrollbars and disable WebKit resizing:<br />
var textarea = $(this).css({resize:&#8217;none&#8217;,'overflow-y&#8217;:'hidden&#8217;}),</p>
<p>to delete ROWS &amp; COLS attributes if the plugin is loaded correctly.<br />
This will make the markup pass the W3C standards by leaving out the ROWS &amp; COLS attributes for clients who don&#8217;t have Javascript enabled, and at the same time stop the ROWS &amp; COLS attributes from affecting the SCROLLTOP value if the plugin works correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-24935</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Tue, 24 Nov 2009 11:59:08 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-24935</guid>
		<description>Also, +1 for Jeferson&#039;s bug - I get the same problem.</description>
		<content:encoded><![CDATA[<p>Also, +1 for Jeferson&#8217;s bug &#8211; I get the same problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-24934</link>
		<dc:creator>Christian</dc:creator>
		<pubDate>Tue, 24 Nov 2009 11:55:11 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-24934</guid>
		<description>Hi James,

great work and very useful!

However... I have found an odd bug (using FF 3.0.15 and 3.5.5 on windows), though and having real trouble figuring out what may be causing it!

If you have exactly 61 lines of text in an &quot;autoresized&quot; text area it works perfectly. (i.e. 60 lines with anything on them and CRLF at the end of the line and a 61st line with just text but no CRLF)

If you have 62 lines (or more) of text then it does not auto-resize. Do you (or anybody else) have any ideas about what might be causing this or how it could be fixed? It seems very odd!

This can be shown by creating 61 lines of text (just blank lines will do) and typing 61 on the last line. If you copy it all and paste into the autoresize box on this page it works fine.

If you then 
(1) clear the box on this page, then 
(2) add a 62nd line to your text document and 
(3) copy/paste the 62 lines of text into the box on this page

You should see that the autoresize area stays at its original (small) size and does not expand. On IE8 the bug manifests slightly differently - very long text results in a text area that does not show all the content on screen, but yet has no scroll bars.

Any ideas or solutions would be great!


Christian</description>
		<content:encoded><![CDATA[<p>Hi James,</p>
<p>great work and very useful!</p>
<p>However&#8230; I have found an odd bug (using FF 3.0.15 and 3.5.5 on windows), though and having real trouble figuring out what may be causing it!</p>
<p>If you have exactly 61 lines of text in an &#8220;autoresized&#8221; text area it works perfectly. (i.e. 60 lines with anything on them and CRLF at the end of the line and a 61st line with just text but no CRLF)</p>
<p>If you have 62 lines (or more) of text then it does not auto-resize. Do you (or anybody else) have any ideas about what might be causing this or how it could be fixed? It seems very odd!</p>
<p>This can be shown by creating 61 lines of text (just blank lines will do) and typing 61 on the last line. If you copy it all and paste into the autoresize box on this page it works fine.</p>
<p>If you then<br />
(1) clear the box on this page, then<br />
(2) add a 62nd line to your text document and<br />
(3) copy/paste the 62 lines of text into the box on this page</p>
<p>You should see that the autoresize area stays at its original (small) size and does not expand. On IE8 the bug manifests slightly differently &#8211; very long text results in a text area that does not show all the content on screen, but yet has no scroll bars.</p>
<p>Any ideas or solutions would be great!</p>
<p>Christian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lex</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-24887</link>
		<dc:creator>Lex</dc:creator>
		<pubDate>Mon, 23 Nov 2009 19:41:21 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-24887</guid>
		<description>Very nice!

Iv got this plugin working nicely but have one problem.
When I edit a record that has lots of text in a textarea, its not expanded (showing all the text) until you type inside the textarea for your plugin to do its thing.

Any ideas? (or know what im talking about :S)

Thanks!</description>
		<content:encoded><![CDATA[<p>Very nice!</p>
<p>Iv got this plugin working nicely but have one problem.<br />
When I edit a record that has lots of text in a textarea, its not expanded (showing all the text) until you type inside the textarea for your plugin to do its thing.</p>
<p>Any ideas? (or know what im talking about :S)</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stian Grytøyr</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-24474</link>
		<dc:creator>Stian Grytøyr</dc:creator>
		<pubDate>Tue, 17 Nov 2009 13:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-24474</guid>
		<description>Great work! 

Quick question: Is there any particular reason Safari’s textarea resize handle disappears when using this plugin? I use those quite a bit myself and wouldn’t want to take away that option for Safari users.</description>
		<content:encoded><![CDATA[<p>Great work! </p>
<p>Quick question: Is there any particular reason Safari’s textarea resize handle disappears when using this plugin? I use those quite a bit myself and wouldn’t want to take away that option for Safari users.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FM</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-23014</link>
		<dc:creator>FM</dc:creator>
		<pubDate>Mon, 26 Oct 2009 10:32:46 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-23014</guid>
		<description>JonathanK &gt; Since I&#039;ve chosen another solution (no displayed text in the textarea), I&#039;ll try your solution if I go back to square one ! Thanks for the help !</description>
		<content:encoded><![CDATA[<p>JonathanK &gt; Since I&#8217;ve chosen another solution (no displayed text in the textarea), I&#8217;ll try your solution if I go back to square one ! Thanks for the help !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JonathanK</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-22823</link>
		<dc:creator>JonathanK</dc:creator>
		<pubDate>Thu, 22 Oct 2009 16:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-22823</guid>
		<description>hey FM, I believe I fixed this by placing a clone.scrollTop(); at the beginning of the updateSize = function() { in autoresize.jquery.js.  This seems to have helped.  But for some weird reason, the fonts and size of resized textareas seem different somehow</description>
		<content:encoded><![CDATA[<p>hey FM, I believe I fixed this by placing a clone.scrollTop(); at the beginning of the updateSize = function() { in autoresize.jquery.js.  This seems to have helped.  But for some weird reason, the fonts and size of resized textareas seem different somehow</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FM</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-22294</link>
		<dc:creator>FM</dc:creator>
		<pubDate>Thu, 15 Oct 2009 09:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-22294</guid>
		<description>Very nice plugin !
However I have a very similar problem to JonathanK.
I&#039;ve put this code to resize the textarea when it gains focus :

$(&#039;#my_textarea&#039;).one(&#039;focus&#039;, function(){
	$(this).trigger(&#039;keydown&#039;);
});

It works fine in FF and Safari, but not under IE8. When focused, the textarea (with content) resizes to an incorrect size, and then when a change/keyup/keydown event occurs, it resizes to the correct size... It seems that the clone.scrollTop() value is incorrect at the time of the focus event.</description>
		<content:encoded><![CDATA[<p>Very nice plugin !<br />
However I have a very similar problem to JonathanK.<br />
I&#8217;ve put this code to resize the textarea when it gains focus :</p>
<p>$(&#8216;#my_textarea&#8217;).one(&#8216;focus&#8217;, function(){<br />
	$(this).trigger(&#8216;keydown&#8217;);<br />
});</p>
<p>It works fine in FF and Safari, but not under IE8. When focused, the textarea (with content) resizes to an incorrect size, and then when a change/keyup/keydown event occurs, it resizes to the correct size&#8230; It seems that the clone.scrollTop() value is incorrect at the time of the focus event.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JonathanK</title>
		<link>http://james.padolsey.com/javascript/jquery-plugin-autoresize/comment-page-2/#comment-21643</link>
		<dc:creator>JonathanK</dc:creator>
		<pubDate>Mon, 05 Oct 2009 20:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://james.padolsey.com/?p=625#comment-21643</guid>
		<description>The first thing I have to say is thanks for this plugin.  It has helped me not have to try to program this myself and saved me a lot of time and work.  But I have one problem I can&#039;t seem to resolve.  I added the .trigger(&#039;change&#039;) to the end of the function to automatically resize textarea when a file is loaded.  It works perfectly in firefox, but in IE7; it somewhat works. For some reason, the resize won&#039;t completely resize the textarea to the correct height.  Once I focus in on the textarea, it resizes again to the correct height.  I don&#039;t know what the problem is.  Just starting looking at jquery</description>
		<content:encoded><![CDATA[<p>The first thing I have to say is thanks for this plugin.  It has helped me not have to try to program this myself and saved me a lot of time and work.  But I have one problem I can&#8217;t seem to resolve.  I added the .trigger(&#8216;change&#8217;) to the end of the function to automatically resize textarea when a file is loaded.  It works perfectly in firefox, but in IE7; it somewhat works. For some reason, the resize won&#8217;t completely resize the textarea to the correct height.  Once I focus in on the textarea, it resizes again to the correct height.  I don&#8217;t know what the problem is.  Just starting looking at jquery</p>
]]></content:encoded>
	</item>
</channel>
</rss>
