나는 마침내 AJAX 및 jQuery 모달 상자에서 발생하는 문제를 해결했습니다.jQuery 효과 : 모달 상자가 열리고 닫을 때
이제 팁을 추가하고 싶습니다. 코드를 모르겠습니다.
효과 하나를 모달 상자가 열리면, 나는 페이드 "배경"을 원하는
효과 두 가지 : 당신이 상자를 닫습니다 X를 쳤을 때, 나는 천천히
퇴색 할봐 :
<script src="js/simplemodal.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#message-sent').hide();
$('#contact-form').submit(function() {
$.ajax({
type: "POST",
url: $(this).attr('action'),
data: $(this).serialize(),
success: function() {
$("#message-sent").modal({
onOpen: function(dialog) {
dialog.overlay.fadeIn('slow', function() {
dialog.container.fadeIn('slow', function() {
dialog.data.fadeIn('slow');
});
});
},
onClose: function (dialog) {
dialog.data.fadeOut('slow', function() {
dialog.container.fadeOut('slow', function() {
dialog.overlay.fadeOut('slow', function() {
$.modal.close();
});
});
});
},
closeClass: 'close-btn'
});
}
});
$('#contact-form')[0].reset();
return false;
});
});
</script>
우수함. 코드를 편집했습니다. 너의 유일한 "실종"(나는 그것을 억압하는 방법을 모르겠어요)의 "어둡게. 그러나 당신이 질문의 75 %를했기 때문에 나는 당신에게 대답을 주었다;) 그러나 이것으로 나를 도우려고 노력해라. 감사. –
도움이 될 수있어서 기쁩니다. "뒤에서 어둡게"하는 것이 무슨 뜻인지 잘 모르겠습니다. 오버레이의 색상을 편집하려고한다고 가정합니다. 그렇다면 다음 CSS를 사용하십시오 :'.simplemodal-overlay {background : rgba (0, 0, 0, 0.75); }' – Snikrs
AWESOME;) 그게 무슨 뜻인지. 감사 –