쇼핑몰: 상품상세보기 본문 이미지 리사이징 처리
This commit is contained in:
@ -522,6 +522,7 @@ input.required:focus {border:1px solid #b8c9c2;background:#21272e !important;col
|
|||||||
|
|
||||||
#sit_inf_basic {margin:0 0 10px}
|
#sit_inf_basic {margin:0 0 10px}
|
||||||
#sit_inf_explan {margin:0 0 10px}
|
#sit_inf_explan {margin:0 0 10px}
|
||||||
|
#sit_inf_explan img {max-width:100%;height:auto}
|
||||||
|
|
||||||
#sit_inf_open {width:100%;border:0;border-collapse:collapse}
|
#sit_inf_open {width:100%;border:0;border-collapse:collapse}
|
||||||
#sit_inf_open th {padding:7px 10px;border:1px solid #fff;background:#f5f6fa;text-align:left}
|
#sit_inf_open th {padding:7px 10px;border:1px solid #fff;background:#f5f6fa;text-align:left}
|
||||||
|
|||||||
@ -685,56 +685,52 @@ else
|
|||||||
menu(id);
|
menu(id);
|
||||||
save_qa_id = id;
|
save_qa_id = id;
|
||||||
}
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
// 상품상세설명에 있는 이미지의 사이즈를 줄임
|
<!--[if lte IE 6]>
|
||||||
// 삭제 대상 - 지운아빠 2013-05-03
|
<script>
|
||||||
function explan_resize_image()
|
// 이미지 등비율 리사이징
|
||||||
|
$(window).load(function() {
|
||||||
|
view_image_resize();
|
||||||
|
});
|
||||||
|
|
||||||
|
function view_image_resize()
|
||||||
{
|
{
|
||||||
var image_width = 600;
|
var $img = $("#sit_inf_explan img");
|
||||||
var div_explan = document.getElementById('div_explan');
|
var img_wrap = $("#sit_inf_explan").width();
|
||||||
if (div_explan) {
|
var win_width = $(window).width() - 35;
|
||||||
var explan_img = div_explan.getElementsByTagName('img');
|
var res_width = 0;
|
||||||
for(i=0;i<explan_img.length;i++)
|
|
||||||
{
|
if(img_wrap < win_width)
|
||||||
//document.write(explan_img[i].src+"<br>");
|
res_width = img_wrap;
|
||||||
img = explan_img[i];
|
else
|
||||||
if (img.width) {
|
res_width = win_width;
|
||||||
imgx = parseInt(img.width);
|
|
||||||
imgy = parseInt(img.height);
|
$img.each(function() {
|
||||||
}
|
var img_width = $(this).width();
|
||||||
else {
|
var img_height = $(this).height();
|
||||||
imgx = parseInt(img.style.width);
|
var this_width = $(this).data("width");
|
||||||
imgy = parseInt(img.style.height);
|
var this_height = $(this).data("height");
|
||||||
}
|
|
||||||
if (imgx > image_width)
|
if(this_width == undefined) {
|
||||||
{
|
$(this).data("width", img_width); // 원래 이미지 사이즈
|
||||||
image_height = parseFloat(imgx / imgy)
|
$(this).data("height", img_height);
|
||||||
if (img.width) {
|
this_width = img_width;
|
||||||
img.width = image_width;
|
this_height = img_height;
|
||||||
img.height = parseInt(image_width / image_height);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
img.style.width = image_width;
|
|
||||||
img.style.height = parseInt(image_width / image_height);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
// 이미지를 가운데로 정렬하는 경우에 주석을 풀어줌
|
|
||||||
img.style.position = 'relative';
|
|
||||||
img.style.left = '50%';
|
|
||||||
img.style.marginLeft = '-300px'; // image_width 의 절반
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
if(this_width > res_width) {
|
||||||
|
$(this).width(res_width);
|
||||||
|
var res_height = Math.round(res_width * $(this).data("height") / $(this).data("width"));
|
||||||
|
$(this).height(res_height);
|
||||||
|
} else {
|
||||||
|
$(this).width(this_width);
|
||||||
|
$(this).height(this_height);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<![endif]-->
|
||||||
<!-- 삭제 대상 -지운아빠 2013-05-03 -->
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(function() {
|
|
||||||
explan_resize_image();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</div><!-- #sit 끝 -->
|
</div><!-- #sit 끝 -->
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user