From c77836ea763bb1ed94b45fdfdc05f62ace186488 Mon Sep 17 00:00:00 2001 From: chicpro Date: Fri, 6 Dec 2013 11:32:49 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=81=ED=92=88=EB=A6=AC=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=EC=8A=A4=ED=83=80=EC=9D=BC=20=EB=B3=80=EA=B2=BD=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/shop.list.js | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/js/shop.list.js b/js/shop.list.js index 556616250..46fbbd021 100644 --- a/js/shop.list.js +++ b/js/shop.list.js @@ -29,6 +29,8 @@ $.fn.listType = function(type) } $el.each(function() { + $(this).removeAttr("style"); + if($(this).data("style")) { $(this).attr("style", $(this).data("style")); } @@ -41,10 +43,31 @@ $.fn.listType = function(type) } this.addClass("sct sct_40"); + var list_top_pad = 20; + var list_right_pad = 10; + var list_bottom_pad = 20; + var list_real_width = 740; + var list_left_pad, list_width, list_height; + var img_width, img_height; + $el.each(function() { - if($(this).data("style")) { - $(this).removeAttr("style"); - } + $(this).removeAttr("style"); + + img_width = $(this).find(".sct_img img").width(); + img_height = $(this).find(".sct_img img").height(); + + list_left_pad = img_width + 10; + list_width = list_real_width - list_right_pad - list_left_pad; + list_height = img_height - list_top_pad - list_bottom_pad; + + $(this).css({ + paddingTop : list_top_pad+"px", + paddingRight: list_right_pad+"px", + paddingBottom: list_bottom_pad+"px", + paddingLeft: list_left_pad+"px", + width: list_width+"px", + height: list_height+"px" + }); }); $("button.sct_lst_list span").addClass("sct_lst_on").html(" 선택됨");