board.js 파일에 아래 항목을 추가 해주세요.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jQuery.resimg = function(element, options){
var setting = { imageWidth:600, borderColor:false }
$.extend(setting, options);
var imageWidth = setting.imageWidth;
var borderColor = setting.borderColor;
$(element).each(function(){
var img_width = $(this).outerWidth();
var img_height = $(this).outerHeight();
//원래 사이즈를 저장한다.
$(this).attr("tmp_width", img_width);
$(this).attr("tmp_height", img_height);
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(img_width > imageWidth) {
imageHeight = parseFloat(img_width/ img_height);
$(this).width(imageWidth).height(parseInt(imageWidth / imageHeight)).css("cursor", "pointer");
//$(this).width(imageWidth).css("cursor", "pointer");
}
if (borderColor) $(this).css({ "border" : "1px solid "+ borderColor });
});
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
그리고 view스킨 파일 최하단스크립트를 아래와 같이 수정하세요.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//제이쿼리 임포트
<script language="JavaScript" src="<?="$g4[path]/js/jquery-latest.js"></script>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<script language="JavaScript">
$(document).ready(function(){
$.resimg("img[name='target_resize_image[]']", {imageWidth:<?=(int)$board[bo_image_width]?>});
//resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
});
</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jQuery.resimg = function(element, options){
var setting = { imageWidth:600, borderColor:false }
$.extend(setting, options);
var imageWidth = setting.imageWidth;
var borderColor = setting.borderColor;
$(element).each(function(){
var img_width = $(this).outerWidth();
var img_height = $(this).outerHeight();
//원래 사이즈를 저장한다.
$(this).attr("tmp_width", img_width);
$(this).attr("tmp_height", img_height);
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(img_width > imageWidth) {
imageHeight = parseFloat(img_width/ img_height);
$(this).width(imageWidth).height(parseInt(imageWidth / imageHeight)).css("cursor", "pointer");
//$(this).width(imageWidth).css("cursor", "pointer");
}
if (borderColor) $(this).css({ "border" : "1px solid "+ borderColor });
});
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
그리고 view스킨 파일 최하단스크립트를 아래와 같이 수정하세요.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//제이쿼리 임포트
<script language="JavaScript" src="<?="$g4[path]/js/jquery-latest.js"></script>
<script language="JavaScript" src="<?="$g4[path]/js/board.js"?>"></script>
<script language="JavaScript">
$(document).ready(function(){
$.resimg("img[name='target_resize_image[]']", {imageWidth:<?=(int)$board[bo_image_width]?>});
//resizeBoardImage(<?=(int)$board[bo_image_width]?>);
drawFont();
});
</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[이 게시물은 관리자님에 의해 2011-10-31 16:55:28 jQuery에서 이동 됨]
댓글 1개
RINIX
16년 전
파폭에서 이미지 팝업 띄울시 에러가 있어 약간의 코드를 수정했습니다.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jQuery.resimg = function(element, options){
var setting = { imageWidth:600, borderColor:false }
$.extend(setting, options);
var imageWidth = setting.imageWidth;
var borderColor = setting.borderColor;
//alert($(element).children().get().length);
$(element).each(function(){
var img_width = $(this).outerWidth();
var img_height = $(this).outerHeight();
//원래 사이즈를 저장한다.
//$(this).attr("tmp_width", img_width);
//$(this).attr("tmp_height", img_height);
var i = $(element).index($(this));
$(element)[i].tmp_width = img_width;
$(element)[i].tmp_height = img_height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(img_width > imageWidth) {
imageHeight = parseFloat(img_width/ img_height);
$(this).width(imageWidth).height(parseInt(imageWidth / imageHeight)).css("cursor", "pointer");
//$(this).width(imageWidth).css("cursor", "pointer");
}
if (borderColor) $(this).css({ "border" : "1px solid "+ borderColor });
});
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
jQuery.resimg = function(element, options){
var setting = { imageWidth:600, borderColor:false }
$.extend(setting, options);
var imageWidth = setting.imageWidth;
var borderColor = setting.borderColor;
//alert($(element).children().get().length);
$(element).each(function(){
var img_width = $(this).outerWidth();
var img_height = $(this).outerHeight();
//원래 사이즈를 저장한다.
//$(this).attr("tmp_width", img_width);
//$(this).attr("tmp_height", img_height);
var i = $(element).index($(this));
$(element)[i].tmp_width = img_width;
$(element)[i].tmp_height = img_height;
// 이미지 폭이 테이블 폭보다 크다면 테이블폭에 맞춘다
if(img_width > imageWidth) {
imageHeight = parseFloat(img_width/ img_height);
$(this).width(imageWidth).height(parseInt(imageWidth / imageHeight)).css("cursor", "pointer");
//$(this).width(imageWidth).css("cursor", "pointer");
}
if (borderColor) $(this).css({ "border" : "1px solid "+ borderColor });
});
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 230 | 20년 전 | 2089 | ||
| 229 | 20년 전 | 3149 | ||
| 228 | 20년 전 | 3342 | ||
| 227 | 20년 전 | 2417 | ||
| 226 | 20년 전 | 5497 | ||
| 225 | 20년 전 | 2538 | ||
| 224 | 20년 전 | 2981 | ||
| 223 | 20년 전 | 4212 | ||
| 222 | 20년 전 | 2612 | ||
| 221 | 20년 전 | 2302 | ||
| 220 | 20년 전 | 3690 | ||
| 219 | 20년 전 | 2084 | ||
| 218 | 20년 전 | 3587 | ||
| 217 | 20년 전 | 2496 | ||
| 216 | 20년 전 | 2935 | ||
| 215 | 20년 전 | 2245 | ||
| 214 | 20년 전 | 3352 | ||
| 213 | 20년 전 | 2933 | ||
| 212 | 20년 전 | 3073 | ||
| 211 | 20년 전 | 2160 | ||
| 210 | 20년 전 | 1930 | ||
| 209 | 20년 전 | 2383 | ||
| 208 | 20년 전 | 2009 | ||
| 207 | 20년 전 | 1692 | ||
| 206 | 20년 전 | 1866 | ||
| 205 | 20년 전 | 3962 | ||
| 204 | 20년 전 | 1684 | ||
| 203 | 20년 전 | 2025 | ||
| 202 | 20년 전 | 2368 | ||
| 201 | 20년 전 | 1840 | ||
| 200 | 20년 전 | 2972 | ||
| 199 | 20년 전 | 2013 | ||
| 198 | 20년 전 | 2098 | ||
| 197 | 20년 전 | 3669 | ||
| 196 | 20년 전 | 3009 | ||
| 195 | 20년 전 | 2119 | ||
| 194 | 20년 전 | 10272 | ||
| 193 | 20년 전 | 2264 | ||
| 192 | 20년 전 | 1616 | ||
| 191 | 20년 전 | 2680 | ||
| 190 | 20년 전 | 2300 | ||
| 189 | 20년 전 | 1702 | ||
| 188 | 20년 전 | 1504 | ||
| 187 | 20년 전 | 1924 | ||
| 186 | 20년 전 | 1752 | ||
| 185 | 20년 전 | 1795 | ||
| 184 | 20년 전 | 2380 | ||
| 183 | 20년 전 | 1590 | ||
| 182 | 20년 전 | 1498 | ||
| 181 | 20년 전 | 1640 | ||
| 180 | 20년 전 | 2737 | ||
| 179 | 20년 전 | 1825 | ||
| 178 | 20년 전 | 1875 | ||
| 177 | 20년 전 | 2002 | ||
| 176 | 20년 전 | 1812 | ||
| 175 | 20년 전 | 1880 | ||
| 174 | 20년 전 | 1712 | ||
| 173 | 20년 전 | 2071 | ||
| 172 | 20년 전 | 1795 | ||
| 171 | 20년 전 | 2578 | ||
| 170 | 20년 전 | 2297 | ||
| 169 | 20년 전 | 2574 | ||
| 168 | 20년 전 | 1513 | ||
| 167 | 20년 전 | 1599 | ||
| 166 | 20년 전 | 2174 | ||
| 165 | 20년 전 | 1659 | ||
| 164 | 20년 전 | 3792 | ||
| 163 | 20년 전 | 2689 | ||
| 162 | 20년 전 | 2109 | ||
| 161 | 20년 전 | 2819 | ||
| 160 | 20년 전 | 1756 | ||
| 159 | 20년 전 | 1635 | ||
| 158 | 20년 전 | 2587 | ||
| 157 | 20년 전 | 1514 | ||
| 156 | 20년 전 | 1774 | ||
| 155 | 20년 전 | 3249 | ||
| 154 | 20년 전 | 1921 | ||
| 153 | 20년 전 | 1637 | ||
| 152 | 20년 전 | 4974 | ||
| 151 | 20년 전 | 4596 | ||
| 150 | 20년 전 | 3537 | ||
| 149 | 20년 전 | 3816 | ||
| 148 | 20년 전 | 7099 | ||
| 147 | 20년 전 | 3569 | ||
| 146 | 20년 전 | 2647 | ||
| 145 | 20년 전 | 2640 | ||
| 144 | 20년 전 | 7177 | ||
| 143 | 20년 전 | 4623 | ||
| 142 | 20년 전 | 1910 | ||
| 141 | 20년 전 | 3266 | ||
| 140 | 20년 전 | 1986 | ||
| 139 | 20년 전 | 1614 | ||
| 138 | 20년 전 | 2331 | ||
| 137 | 20년 전 | 1805 | ||
| 136 | 20년 전 | 1471 | ||
| 135 | 20년 전 | 1811 | ||
| 134 | 20년 전 | 2989 | ||
| 133 | 20년 전 | 2472 | ||
| 132 | 20년 전 | 1714 | ||
| 131 | 20년 전 | 1666 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기