#448 에 따른 이미지 리사이즈 스크립트 수정
This commit is contained in:
@ -217,6 +217,26 @@ $(window).load(function() {
|
||||
view_image_resize();
|
||||
});
|
||||
|
||||
var rtime = new Date();
|
||||
var timeout = false;
|
||||
var delta = 200;
|
||||
$(window).resize(function() {
|
||||
rtime = new Date();
|
||||
if (timeout === false) {
|
||||
timeout = true;
|
||||
setTimeout(resizeend, delta);
|
||||
}
|
||||
});
|
||||
|
||||
function resizeend() {
|
||||
if (new Date() - rtime < delta) {
|
||||
setTimeout(resizeend, delta);
|
||||
} else {
|
||||
timeout = false;
|
||||
view_image_resize();
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("a.view_image").click(function() {
|
||||
window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
|
||||
@ -240,14 +260,27 @@ function view_image_resize()
|
||||
{
|
||||
var $img = $("#bo_v_atc img");
|
||||
var img_wrap = $("#bo_v_atc").width();
|
||||
var win_width = $(window).width() - 35;
|
||||
var res_width = 0;
|
||||
|
||||
if(img_wrap < win_width)
|
||||
res_width = img_wrap;
|
||||
else
|
||||
res_width = win_width;
|
||||
|
||||
$img.each(function() {
|
||||
var img_width = $(this).width();
|
||||
$(this).data("width", img_width); // 원래 이미지 사이즈
|
||||
if (img_width > img_wrap) {
|
||||
$(this).addClass("img_fix");
|
||||
} else if (img_width <= img_wrap && img_width >= $(this).data("width")) {
|
||||
$(this).removeClass("img_fix");
|
||||
var this_width = $(this).data("width");
|
||||
|
||||
if(this_width == undefined) {
|
||||
$(this).data("width", img_width); // 원래 이미지 사이즈
|
||||
this_width = img_width;
|
||||
}
|
||||
|
||||
if(this_width > res_width) {
|
||||
$(this).width(res_width);
|
||||
} else {
|
||||
$(this).width(this_width);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -215,6 +215,26 @@ $(window).load(function() {
|
||||
view_image_resize();
|
||||
});
|
||||
|
||||
var rtime = new Date();
|
||||
var timeout = false;
|
||||
var delta = 200;
|
||||
$(window).resize(function() {
|
||||
rtime = new Date();
|
||||
if (timeout === false) {
|
||||
timeout = true;
|
||||
setTimeout(resizeend, delta);
|
||||
}
|
||||
});
|
||||
|
||||
function resizeend() {
|
||||
if (new Date() - rtime < delta) {
|
||||
setTimeout(resizeend, delta);
|
||||
} else {
|
||||
timeout = false;
|
||||
view_image_resize();
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("a.view_image").click(function() {
|
||||
window.open(this.href, "large_image", "location=yes,links=no,toolbar=no,top=10,left=10,width=10,height=10,resizable=yes,scrollbars=no,status=no");
|
||||
@ -238,14 +258,27 @@ function view_image_resize()
|
||||
{
|
||||
var $img = $("#bo_v_atc img");
|
||||
var img_wrap = $("#bo_v_atc").width();
|
||||
var win_width = $(window).width() - 35;
|
||||
var res_width = 0;
|
||||
|
||||
if(img_wrap < win_width)
|
||||
res_width = img_wrap;
|
||||
else
|
||||
res_width = win_width;
|
||||
|
||||
$img.each(function() {
|
||||
var img_width = $(this).width();
|
||||
$(this).data("width", img_width); // 원래 이미지 사이즈
|
||||
if (img_width > img_wrap) {
|
||||
$(this).addClass("img_fix");
|
||||
} else if (img_width <= img_wrap && img_width >= $(this).data("width")) {
|
||||
$(this).removeClass("img_fix");
|
||||
var this_width = $(this).data("width");
|
||||
|
||||
if(this_width == undefined) {
|
||||
$(this).data("width", img_width); // 원래 이미지 사이즈
|
||||
this_width = img_width;
|
||||
}
|
||||
|
||||
if(this_width > res_width) {
|
||||
$(this).width(res_width);
|
||||
} else {
|
||||
$(this).width(this_width);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user