2023/12/12 선거문자 전체 체크박스 클릭 시 순차적으로 선택
@61040f78e932c933712def1959a3ccd3e6568971
--- src/main/webapp/publish/js/publish.js
+++ src/main/webapp/publish/js/publish.js
... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 |
|
| 13 | 13 |
var publishCommon = {
|
| 14 | 14 |
count: 0, |
| 15 |
- longMousePressCheck: function (checkTarget, checkTime) {
|
|
| 15 |
+ longMousePressCheck: function (checkTarget, checkTime , $target) {
|
|
| 16 | 16 |
// checkTarget → 체크박스([name='']) / checkTime → 몇초 간격으로 체크 될지 |
| 17 | 17 |
var checkLength = checkTarget.length; // 체크박스 몇개인지 |
| 18 | 18 |
var cnt = 0; // 몇개 체크됐는지 |
... | ... | @@ -22,6 +22,10 @@ |
| 22 | 22 |
clearInterval(checkEvent); // 자동체크 끝. |
| 23 | 23 |
} |
| 24 | 24 |
$(checkTarget[cnt]).prop('checked', true); // 체크박스 체크.
|
| 25 |
+ $($target).on("mouseup",function(){
|
|
| 26 |
+ //마우스떼면 멈춤 |
|
| 27 |
+ clearInterval(checkEvent); |
|
| 28 |
+ }); |
|
| 25 | 29 |
cnt++; |
| 26 | 30 |
}, checkTime); |
| 27 | 31 |
}, |
--- src/main/webapp/publish/sub_election_2023.html
+++ src/main/webapp/publish/sub_election_2023.html
... | ... | @@ -54,10 +54,20 @@ |
| 54 | 54 |
} |
| 55 | 55 |
}); |
| 56 | 56 |
|
| 57 |
- onlongclick(".btn_check_one", 1000, function () {
|
|
| 57 |
+ $(".input_wrap #checkAll").click(function(){
|
|
| 58 | 58 |
var checkbox = $('[name=receipt_number_check]');
|
| 59 |
- publishCommon.longMousePressCheck(checkbox, 300); |
|
| 59 |
+ if($(this).is(":checked") !== true){
|
|
| 60 |
+ checkbox.prop("checked",false);
|
|
| 61 |
+ }else{
|
|
| 62 |
+ publishCommon.longMousePressCheck(checkbox, 100); |
|
| 63 |
+ } |
|
| 60 | 64 |
}); |
| 65 |
+ |
|
| 66 |
+ onlongclick(".btn_check_one", 100, function (e) {
|
|
| 67 |
+ var checkbox = $('[name=receipt_number_check]');
|
|
| 68 |
+ publishCommon.longMousePressCheck(checkbox, 100, $(".btn_check_one"));
|
|
| 69 |
+ }); |
|
| 70 |
+ |
|
| 61 | 71 |
|
| 62 | 72 |
$(".btn_check_one").click(function(){
|
| 63 | 73 |
var checkbox = $('[name=receipt_number_check]');
|
... | ... | @@ -1339,7 +1349,7 @@ |
| 1339 | 1349 |
<div class="put_left"> |
| 1340 | 1350 |
<div class="listType list"> |
| 1341 | 1351 |
<ul class="thead_ul table_ul"> |
| 1342 |
- <li></li> |
|
| 1352 |
+ <li><div class="input_wrap"><input type="checkbox" id="checkAll" name="receipt_number_check"></div></li> |
|
| 1343 | 1353 |
<li> |
| 1344 | 1354 |
번호 |
| 1345 | 1355 |
<button type="button" class="btn_sort_up"><img src="/publish/images/sortUp.png"></button> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?