사용자: 게시판 읽기 이미지 등비율 리사이징
This commit is contained in:
@ -9,6 +9,9 @@ form, img {border:0}
|
|||||||
input, img {vertical-align:middle}
|
input, img {vertical-align:middle}
|
||||||
p {margin:10px 0;line-height:1.5em}
|
p {margin:10px 0;line-height:1.5em}
|
||||||
|
|
||||||
|
/* 이미지 등비율 리사이징 */
|
||||||
|
.img_fix {float:left;width:100%;height:auto}
|
||||||
|
|
||||||
/* 내용 건너뛰기 */
|
/* 내용 건너뛰기 */
|
||||||
#to_content a {display:block;position:absolute;top:0;left:0;margin:5px;height:0;text-decoration:none;overflow:hidden}
|
#to_content a {display:block;position:absolute;top:0;left:0;margin:5px;height:0;text-decoration:none;overflow:hidden}
|
||||||
#to_content a:focus,
|
#to_content a:focus,
|
||||||
|
|||||||
@ -171,5 +171,20 @@ function file_download(link, file) {
|
|||||||
<!-- 게시글 보기 끝 -->
|
<!-- 게시글 보기 끝 -->
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
//이미지등비율리사이즈 스크립트 추가 요망ㅎ
|
// 이미지 등비율 리사이징
|
||||||
|
$(document).ready(function(){
|
||||||
|
var img = $('article img');
|
||||||
|
var img_org_width = img.width();
|
||||||
|
$(window).resize(function(){
|
||||||
|
var wrapper_width = $('#wrapper').width();
|
||||||
|
img.each(function() {
|
||||||
|
var img_width = $(this).width();
|
||||||
|
if (img_width > wrapper_width) {
|
||||||
|
$(this).addClass('img_fix');
|
||||||
|
} else if (img_width <= wrapper_width && img_width >= img_org_width) {
|
||||||
|
$(this).removeClass('img_fix');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).resize();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user