From f97d38d8963164dfbeef50d6b62c74e8ec7714cb Mon Sep 17 00:00:00 2001 From: Igor Pnev Date: Tue, 3 Jun 2014 06:20:38 +0400 Subject: [PATCH] Fixed width in percent. --- jquery.sticky-kit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.sticky-kit.js b/jquery.sticky-kit.js index 6dd08bf..570dab4 100644 --- a/jquery.sticky-kit.js +++ b/jquery.sticky-kit.js @@ -63,7 +63,7 @@ height = elm.outerHeight(true); el_float = elm.css("float"); spacer.css({ - width: elm.outerWidth(true), + width: Math.floor(elm.outerWidth(true)), height: height, display: elm.css("display"), "vertical-align": elm.css("vertical-align"), @@ -132,7 +132,7 @@ position: "fixed", top: offset }; - css.width = elm.css("box-sizing") === "border-box" ? elm.outerWidth() + "px" : elm.width() + "px"; + css.width = elm.css("box-sizing") === "border-box" ? Math.floor(elm.outerWidth()) + "px" : Math.floor(elm.width()) + "px"; elm.css(css).addClass(sticky_class).after(spacer); if (el_float === "left" || el_float === "right") { spacer.append(elm);