Skip to content

Commit f9cca71

Browse files
committed
Merge pull request rochal#54 from chawkinsuf/master
Refresh slimscroll height for content changes
2 parents a5fb1b6 + 7b3a56e commit f9cca71

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

jquery.slimscroll.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@
102102
// check if we should scroll existing instance
103103
if ($.isPlainObject(options))
104104
{
105+
// Pass height: auto to an existing slimscroll object to force a resize after contents have changed
106+
if ( 'height' in options && options.height == 'auto' ) {
107+
me.parent().css('height', 'auto');
108+
me.css('height', 'auto');
109+
var height = me.parent().parent().innerHeight();
110+
me.parent().css('height', height);
111+
me.css('height', height);
112+
}
113+
105114
if ('scrollTo' in options)
106115
{
107116
// jump to a static point

0 commit comments

Comments
 (0)