나는 사용자에게 확인 대화 상자를 표시하여 변수가 전달 된 동작을 확인하는 JavaScript가 있습니다.변경 js 트위터 부트 스트랩 모달에 확인
그러나 일반 확인 대화 상자를 twitter-bootstrap 모달로 변경해야합니다.
여러 번 시도했는데 많은 게시물을 읽고 트위터 부트 스트랩 워드 프로세서를 읽었지 만 js에 대한 지식이 부족하여 제대로 작동하지 않습니다. 나는 트위터 부트 스트랩 모달의 변수 표시를 고수하고있다.
나는 약간의 조언을 주면서 나를 도울 수 있기를 바라고있다. 여기
내 현재 JS 대화 코드 :function checkboxUpdated(checkbox, count, label, id) {
if (checkbox.checked) {
$('#menu_entry_' + id).show();
} else {
if (count > 0) {
if (! confirm('{% trans "You have '+ count +' saved '+ label +'.\n\nIf you leave this option un-checked your saved '+ label +' will be deleted only after you update this page.\n\nAre you sure you want to delete your ' + count + ' saved ' + label +'?" %}')) {
checkbox.checked = true;
return;
}
}
$('#menu_entry_' + id).hide();
}
}
편집 : 나는 다음과 같은 JS를 변환 할 필요가
{% for id, menu_entry, selected, item_count in menu_entries %}
<li id="menu_entry_{{ id }}" {% if not selected %}style="display:none;"{% endif %}>
<a
{% if id == 4 %}
href="{% url summary_details %}"
{% elif id == 8 %}
href="{% url objective_details %}"
{% elif id == 12 %}
href="{% url leading_employment_details %}"
{% elif id == 16 %}
href="{% url desired_occupation_details %}"
....
{% elif id == 112 %}
href="/"
{% else %}
href="/"
{% endif %}
onclick="showProgressAnimation();">
참고 : 주석의 요청에 따라 #menu_entry_의 코드를 추가 트위터 부트 스트랩 모달 코드로 코드 확인 :
if (! confirm('{% trans "You have '+ count +' saved '+ label +'.\n\nIf you leave this option un-checked your saved '+ label +' will be deleted only after you update this page.\n\nAre you sure you want to delete your ' + count + ' saved ' + label +'?" %}')) {
'# menu_entry_ *'에 대한 HTML을 볼 필요가 있습니다. – cvrebert