diff --git a/lib/sticky.js b/lib/sticky.js index 9c2f7fb..818d218 100644 --- a/lib/sticky.js +++ b/lib/sticky.js @@ -151,9 +151,12 @@ if ( bodyClass ) { $body.addClass(bodyClass); - $elem.addClass(stickyClass); } + if(stickyClass){ + $elem.addClass(stickyClass); + } + $elem .css('width', elem.offsetWidth+'px') .css('position', 'fixed')