mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
게시글내 이미지 리사이즈 제대로 동작되도록 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3047 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cce31a5c07
commit
aa104c3847
1 changed files with 6 additions and 8 deletions
|
|
@ -240,20 +240,18 @@ function resizeImageContents() {
|
|||
var orig_img = new Image();
|
||||
orig_img.src = obj.src;
|
||||
|
||||
if(parent_width<1 || obj_width <1 || parent_width >= orig_img.width) continue;
|
||||
if(parent_width<1 || obj_width <1 || parent_width-20 >= orig_img.width) continue;
|
||||
|
||||
obj.style.cursor = "pointer";
|
||||
|
||||
obj.source_width = orig_img.width;
|
||||
obj.source_height = orig_img.height;
|
||||
|
||||
if(obj_width >= parent_width) {
|
||||
var new_w = parent_width-10;
|
||||
var new_h = Math.round(xHeight(obj)*new_w/obj_width);
|
||||
|
||||
xWidth(obj, new_w);
|
||||
xHeight(obj, new_h);
|
||||
}
|
||||
var new_w = parent_width-20;
|
||||
var new_h = Math.round(orig_img.height * new_w/orig_img.width);
|
||||
|
||||
xWidth(obj, new_w);
|
||||
xHeight(obj, new_h);
|
||||
|
||||
xAddEventListener(obj,"click", showOriginalImage);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue