From 4416401dde0ada781f2d49afc30ce252978f31e8 Mon Sep 17 00:00:00 2001 From: aprovent Date: Fri, 17 Apr 2015 11:13:05 +0200 Subject: [PATCH] Issues when container has Paddings Issues when styling #menu-columnview-container with paddings --- jquery.columnview.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jquery.columnview.js b/jquery.columnview.js index f2eb999..a8cd9ed 100755 --- a/jquery.columnview.js +++ b/jquery.columnview.js @@ -201,7 +201,8 @@ jQuery.fn.mapAttributes = function(prefix) { remainingspace += $(item).width(); }); var fillwidth = $(container).width() - remainingspace; - $(previewcontainer).css({'top':0,'left':remainingspace}).width(fillwidth).show(); + var topPos = parseInt(container.css('paddingTop')); + $(previewcontainer).css({'top':topPos,'left':remainingspace}).width(fillwidth).show(); } } @@ -350,13 +351,14 @@ jQuery.fn.mapAttributes = function(prefix) { width = typeof settings.fixedwidth == "string" ? settings.fixedwidth : '200px'; } - var leftPos = 0; + var topPos = parseInt(container.css('paddingTop')); + var leftPos = parseInt(container.css('paddingLeft')); $.each($(container).children('div'), function(i, mydiv){ - leftPos += $(mydiv).width(); + leftPos += $(mydiv).outerWidth(); }); if (!submenu) { - submenu = $('
').css({'top':0, 'left':leftPos}).appendTo(container); + submenu = $('
').css({'top':topPos, 'left':leftPos}).appendTo(container); } // Set column width