diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-20 07:06:36 +0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-08-20 07:11:13 +0800 |
commit | b989383fe6f875d48c48c4b5481299ddc70e5766 (patch) | |
tree | 04fe21760cf7cdf1c85d8abf1fe27440cefe41aa | |
parent | 407ce45bc547be23595f225dbd020f490ff58afe (diff) |
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 <tnalmdal@shaw.ca>
-rw-r--r-- | lib/gallery.common.js | 4 |
1 files changed, 2 insertions, 2 deletions
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); }; |