<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');
<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>
[이 게시물은 관리자님에 의해 2011-10-31 16:55:28 jQuery에서 이동 됨]
댓글 2개
15년 전
좋은 정보 감사드려요
적용해 보아야겠네요
적용해 보아야겠네요
끙디자이너
15년 전
http://sir.co.kr/bbs/board.php?bo_table=tip_jquery&wr_id=12&sca=&sfl=&stx=&spt=0&page=5
웹자인님 그만쫌 하시죠.. 포인트가 중요하시면 커뮤니티를 하세요
참 보기 않좋네요
웹자인님 그만쫌 하시죠.. 포인트가 중요하시면 커뮤니티를 하세요
참 보기 않좋네요
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5752 | 10년 전 | 491 | ||
| 5751 | 10년 전 | 533 | ||
| 5750 | 10년 전 | 332 | ||
| 5749 | 10년 전 | 405 | ||
| 5748 | 10년 전 | 805 | ||
| 5747 | 10년 전 | 583 | ||
| 5746 | 10년 전 | 298 | ||
| 5745 | 10년 전 | 339 | ||
| 5744 | 10년 전 | 343 | ||
| 5743 | 10년 전 | 279 | ||
| 5742 | 10년 전 | 284 | ||
| 5741 | 10년 전 | 636 | ||
| 5740 | 10년 전 | 314 | ||
| 5739 | 10년 전 | 306 | ||
| 5738 |
프로그램은어려워
|
10년 전 | 922 | |
| 5737 | 10년 전 | 497 | ||
| 5736 | 10년 전 | 396 | ||
| 5735 | 10년 전 | 400 | ||
| 5734 |
잘살아보자
|
10년 전 | 603 | |
| 5733 |
잘살아보자
|
10년 전 | 558 | |
| 5732 |
잘살아보자
|
10년 전 | 960 | |
| 5731 |
잘살아보자
|
10년 전 | 308 | |
| 5730 |
|
10년 전 | 1278 | |
| 5729 |
잘살아보자
|
10년 전 | 542 | |
| 5728 |
잘살아보자
|
10년 전 | 359 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기