From bc9f6378aa9e1ee4bc1f07cc8afa37344dd6c75b Mon Sep 17 00:00:00 2001 From: zero Date: Sat, 23 May 2009 10:22:16 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=A6=AC?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EC=A6=88=EA=B0=81=20=EA=B0=9C=EB=B3=84=20?= =?UTF-8?q?=EC=BB=A8=ED=85=90=EC=B8=A0=EC=97=90=EC=84=9C=20=EC=9E=98=20?= =?UTF-8?q?=EB=8F=99=EC=9E=91=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6372 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- addons/resize_image/js/resize_image.js | 74 +++++++++++++------------- common/css/default.css | 2 +- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/addons/resize_image/js/resize_image.js b/addons/resize_image/js/resize_image.js index dd3ecd111..9f8b5982e 100644 --- a/addons/resize_image/js/resize_image.js +++ b/addons/resize_image/js/resize_image.js @@ -157,48 +157,50 @@ function slideshow(event) { xScreen.xeShow(); } -$(window).load(function(){ +$(document).ready(function(){ var regx_skip = /(?:modules|addons|classes|common|layouts|libs|widgets)/i; var regx_parent = /(?:document|comment)_[0-9]+_[0-9]+/i; - var xe_content = $(".xe_content"); - var overflow = xe_content.css("overflow"); - var width = xe_content.css("width"); - xe_content.css("overflow","hidden"); - xe_content.css("width","100%"); - var offsetWidth = xe_content.attr("offsetWidth"); - xe_content.css("overflow",overflow); - xe_content.css("width",width); + $(".xe_content").each(function() { + $(this).find("img").each(function(){ + var img = $(this); + var width = img.attr("width"); + if(!width) width = img.width(); + img.attr("orig_width",width); + img.attr("width",1); + }); + var offsetWidth = $(this).width(); - // 이미지 목록을 가져와서 리사이즈 - $(".xe_content img").each(function(){ - var img = $(this); - var src = img.attr("src"); - var width = img.attr("width"); - var height = img.attr("height"); - - // XE 내부 프로그램 또는 스킨의 이미지라면 이미지 리사이즈를 하지 않음 - if ( regx_skip.test(src) ) return; - - // 커스텀 속성 추가 - img.attr("rel", "xe_gallery"); - - // 크기를 계산한다 - if(width>offsetWidth) { - img.attr("width",offsetWidth-1); - img.attr("height",parseInt(offsetWidth/width*height,10)); - } - - // 링크가 설정되어 있거나 onclick 이벤트가 부여되어 있으면 원본 보기를 하지 않음 - if ( !img.parent("a").size() && !img.attr("onclick") ) { - // 스타일 설정 - img.css("cursor", "pointer"); + $(this).find("img").each(function(){ + var img = $(this); + var src = img.attr("src"); + img.attr("width",img.attr("orig_width")); + img.removeAttr("orig_width",''); + var width = img.attr("width"); + var height = img.attr("height"); - // 클릭하면 슬라이드쇼 시작 - img.click(slideshow); - } + // XE 내부 프로그램 또는 스킨의 이미지라면 이미지 리사이즈를 하지 않음 + if ( !regx_skip.test(src) ) { + // 커스텀 속성 추가 + img.attr("rel", "xe_gallery"); - }); + // 크기를 계산한다 + if(width>offsetWidth) { + img.attr("width",offsetWidth-10); + img.attr("height",parseInt(offsetWidth/width*height,10)); + } + + // 링크가 설정되어 있거나 onclick 이벤트가 부여되어 있으면 원본 보기를 하지 않음 + if ( !img.parent("a").size() && !img.attr("onclick") ) { + // 스타일 설정 + img.css("cursor", "pointer"); + + // 클릭하면 슬라이드쇼 시작 + img.click(slideshow); + } + } + }); + }); }); })(jQuery); diff --git a/common/css/default.css b/common/css/default.css index e4344407b..010e4d928 100644 --- a/common/css/default.css +++ b/common/css/default.css @@ -73,7 +73,7 @@ a.bold { font-weight:bold; } .folder_closer { display: none; } .folder_area { display: none; } -.xe_content { line-height:1.6; } +.xe_content { line-height:1.6; overflow:hidden; display:inline;} .zbxe_widget_output { background:url(../tpl/images/widget_text.gif) no-repeat center bottom; display:block;}