Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed page jump bug, closes #1

  • Loading branch information...
commit d36222ee5e5324a7f5a4192b8d4ca514aa5347d0 1 parent 0078b9d
Jonathan Azoff authored
Showing with 10 additions and 6 deletions.
  1. +4 −2 README.md
  2. +6 −4 jquery.autoresize.js
View
6 README.md
@@ -1,6 +1,6 @@
-AutoResize v1.1.0
+AutoResize v1.1.1
=================
-Tuesday, August 24th 2011
+Sunday, September 25th 2011
AutoResize is a jQuery Plugin that matches a textarea to the height of its text content.
It is intended to be used with the latest version of jQuery: <http://code.jquery.com/jquery-latest.js>
@@ -47,6 +47,8 @@ features. Special thanks to RentJuice and the entire dev team for allowing this
Change Log
----------
+ * __1.1.1__
+ - Fixed page jump behavior on autoscroll ([issue](https://github.com/azoff/AutoResize/issues/1))
* __1.1.0__
- No more clones, long live scrollHeight!
* __1.0.0__
View
10 jquery.autoresize.js
@@ -1,5 +1,5 @@
/** @license
- * AutoResize v1.1.0
+ * AutoResize v1.1.1
* A jQuery Plugin that matches a textarea to the height of its text content
* http://azoffdesign.com/autoresize
*
@@ -13,7 +13,7 @@
* For API documentation, see the README file
* https://github.com/azoff/AutoResize/blob/master/README.md
*
- * Date: Tuesday, August 24th 2011
+ * Date: Sunday, September 25th 2011
*/
/*jslint onevar: true, strict: true */
@@ -22,7 +22,7 @@
"use strict";
- (function($, plugins) { var
+ (function($, plugins, frame) { var
ALLOWED_NODES = 'textarea',
@@ -44,8 +44,10 @@
targetHeight = target.height(),
scrollOffset = target.data('scrollOffset'),
minHeight = target.data('minHeight'),
+ scrollTop = frame.scrollTop(),
scrollHeight = target.height(minHeight).prop('scrollHeight') - scrollOffset;
target.height(scrollHeight);
+ frame.scrollTop(scrollTop);
if (targetHeight !== scrollHeight) {
target.trigger('autoresize:resize', scrollHeight);
}
@@ -60,4 +62,4 @@
return this.filter(ALLOWED_NODES).each(apply);
};
-})(jQuery, jQuery.fn);
+})(jQuery, jQuery.fn, jQuery(window));
Please sign in to comment.
Something went wrong with that request. Please try again.