간결함이 무기인데 기본이 없다보니 코드가 엉망입니다.
좀 줄여주세요. ^^
<input type=text name='ct_qty' id='ct_qty' value='1' size=4 maxlength=4 class=ed autocomplete='off' style='text-align:right;' onkeyup='calc_amount()'>
<img src='img/qty_control.gif' border=0 align=absmiddle usemap="#qty_control_map"> 개
<map name="qty_control_map">
<area shape="rect" coords="0, 0, 10, 9" id='qty_plus'>
<area shape="rect" coords="0, 10, 10, 19" id='qty_minus'>
</map>
... 중략 ...
<script>
// 위,아래 이미지 클릭으로 수량 조절
$(document).ready(function() {
var $this = $('#ct_qty');
$('#qty_plus').click(function() {
if (isNaN(parseInt($this.val()))) {
$this.val(1);
}
else {
$this.val(parseInt($this.val()) + 1);
}
}).css('cursor', 'pointer');
$('#qty_minus').click(function() {
if (isNaN(parseInt($this.val()))) {
$this.val(1);
}
else {
$this.val(parseInt($this.val()) - 1);
if ($this.val() < 1) $this.val(1);
}
}).css('cursor', 'pointer');
});
</script>
게시글 목록
| 번호 | 제목 |
|---|---|
| 11832 |
jQuery
remove()를 이용하여 엘리먼트 삭제하기
|
| 11829 | |
| 11826 |
jQuery
동일 엘리먼트 순번 알아내기
2
|
| 11823 | |
| 11822 | |
| 11821 | |
| 11820 |
jQuery
position() 메서드 객체에 대한 좌표값
|
| 11819 | |
| 20318 | |
| 11818 | |
| 11817 | |
| 11816 | |
| 11814 | |
| 11813 | |
| 11811 | |
| 11810 |
jQuery
class가 있는지 없는지 체크하기
|
| 11809 |
PHP
배열에서 중복 값 없애기
|
| 11808 | |
| 11807 |
JavaScript
str_pad 자릿수만큼 특정문자로 채우기
|
| 11806 | |
| 11805 | |
| 11804 | |
| 11803 | |
| 11802 | |
| 11801 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기