mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-20 02:42:23 +09:00
이미지 리사이즈각 개별 컨텐츠에서 잘 동작하도록 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6372 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2af9763acd
commit
bc9f6378aa
2 changed files with 39 additions and 37 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue