From b989383fe6f875d48c48c4b5481299ddc70e5766 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 20 Aug 2009 07:06:36 +0800 Subject: Modified the conversion of the margin-top and margin-bottom css values. The problem arises because $(selector).css("margin-top) does not return a string and therefore the replace function is undefined. Signed-off-by: Tim Almdal --- lib/gallery.common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/gallery.common.js') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index e00eb62a..06775d79 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -89,8 +89,8 @@ */ $.fn.gallery_height = function() { var ht = $(this).height(); - var mt = $(this).css("margin-top").replace("px",""); - var mb = $(this).css("margin-bottom").replace("px",""); + var mt = parseInt($(this).css("margin-top")); + var mb = parseInt($(this).css("margin-bottom")); return ht + parseInt(mt) + parseInt(mb); }; -- cgit v1.2.3