From 0fc3b3798df9ed1c56c2e2bd1d428c5d0cf8c266 Mon Sep 17 00:00:00 2001 From: good_spring Date: Tue, 25 Aug 2020 13:06:53 +0430 Subject: [PATCH] fix bug in assigning first and last columns classes when it's scrolling horizontally --- src/jquery.columnizer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jquery.columnizer.js b/src/jquery.columnizer.js index 7536e0b..6be00df 100644 --- a/src/jquery.columnizer.js +++ b/src/jquery.columnizer.js @@ -740,9 +740,9 @@ $col = $inBox.children().eq(i); $col.width(optionWidth + "px"); if(i === 0){ - $col.addClass(prefixTheClassName("first")); + $col.removeClass(prefixTheClassName("last")); }else if(i==$inBox.children().length-1){ - $col.addClass(prefixTheClassName("last")); + $col.removeClass(prefixTheClassName("first")); }else{ $col.removeClass(prefixTheClassName("first")); $col.removeClass(prefixTheClassName("last"));