Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Refresh slimscroll height for content changes #54

Merged
merged 1 commit into from

5 participants

@chawkinsuf

Added the processing of { height: 'auto' } for re-initializing the height of an existing instance. The div heights are recalculated based on the original wrapping div. This ensures a proper resize when using max-height to set the height of the original wrapping div.

@sualko

+1

@ibc

+1

@rochal rochal merged commit f9cca71 into rochal:master
@caca9512

can you add this code too, for refresh the height with custom value.
Line 117
after if ('height' in options && options.height == 'auto')
...

      if ('height' in options && options.height != 'auto') {
          me.parent().css('height', o.height);
          me.css('height', o.height);
        }

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 16, 2013
  1. @chawkinsuf
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +9 −0 jquery.slimscroll.js
View
9 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
Something went wrong with that request. Please try again.