다음 링크에서 로그인 모달을 다운로드했습니다. http://www.alessioatzeni.com/blog/login-box-modal-dialog-window-with-css-and-jquery/로드시이 모달 윈도우를 여는 방법 - PHP
CSS에 몇 가지 변경 사항을 적용했지만 그게 전부입니다.
여기에 내가 페이지로드로드이 모달 필요 .. 기본적으로
$(document).ready(function() {
$('a.loginbutton').click(function() {
// Getting the variable's value from a link
var loginBox = $(this).attr('href');
//Fade in the Popup and add close button
$(loginBox).fadeIn(300);
$.fn.formLabels(); //Initialize form labels
//Set the center alignment padding + border
var popMargTop = ($(loginBox).height() + 24)/2;
var popMargLeft = ($(loginBox).width() + 24)/2;
$(loginBox).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
// Add the mask to body
$('body').append('<div id="mask"></div>');
$('#mask').fadeIn(300);
return false;
});
// When clicking on the button close or the mask layer the popup closed
$('a.close, #mask').live('click', function() {
$('#mask , .login-popup').fadeOut(300 , function() {
$('#mask').remove();
});
return false;
});
});
내가 버튼을 클릭하면 모달 창을 시작하는 jQuery 코드입니다. 간신히 jQuery를 알기 때문에 플러그인을 다운로드 한 이유는 무엇입니까? 나는이 일을 정말로 필요로한다.
이 코드를 작성한 사람에게 이미 연락을 시도했지만 답장을 보내지 않았습니다.