Permalink
Browse files

Merge pull request #54 from chawkinsuf/master

Refresh slimscroll height for content changes
  • Loading branch information...
2 parents a5fb1b6 + 7b3a56e commit f9cca71a44c8fc794d15ea169612751492182f9b @rochal committed Mar 21, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 jquery.slimscroll.js
@@ -102,6 +102,15 @@
// check if we should scroll existing instance
if ($.isPlainObject(options))
{
+ // Pass height: auto to an existing slimscroll object to force a resize after contents have changed
+ if ( 'height' in options && options.height == 'auto' ) {
+ me.parent().css('height', 'auto');
+ me.css('height', 'auto');
+ var height = me.parent().parent().innerHeight();
+ me.parent().css('height', height);
+ me.css('height', height);
+ }
+
if ('scrollTo' in options)
{
// jump to a static point

0 comments on commit f9cca71

Please sign in to comment.