설치 프로세스를 안내하는 단계별 프로세스가 있습니다. 한 페이지에 들어있는 모든 코드를 원합니다 (즉, setup1.php가 아니라 step1.php, step2.php 및 step3.php가 있음을 의미합니다). 나는이 같은 jQuery를에 코딩했습니다 (그것은 단지 한 번에 한 단계를 보여줍니다)jQuery에서 단계별 프로세스가 있습니다. 코드를 작성하는 더 좋은 방법이 있습니까?
$(document).ready(function() {
// Hide all sections
$("article").hide();
// Show intro
$("#intro").fadeIn("slow").delay(500).slideDown("slow", function() {
// Listen for user to click "next" link
$("#intro .next").click(function() {
// Hide intro
$("#intro").fadeOut("fast").delay(500).slideUp("fast", function() {
// Show EULA section
$("#eula").fadeIn("slow").delay(500).slideDown("slow", function() {
// Listen for user to click "next" link
$("#eula .next").click(function() {
$("#eula").fadeOut("fast").delay(500).slideUp("fast", function() {
// Show site section
$("#site").fadeIn("slow").delay(500).slideDown("slow", function() {
// Listen for user to click "next" link
$("#site .next").click(function() {
$("#site").fadeOut("fast").delay(500).slideUp("fast", function() {
// Show database section
$("#database").fadeIn("slow").delay(500).slideDown("slow", function() {
// Listen for user to click "next" link
$("#database .next").click(function() {
$("#database").fadeOut("fast").delay(500).slideUp("fast", function() {
// Show email section
$("#email").fadeIn("slow").delay(500).slideDown("slow", function() {
$("#email .next").click(function() {
$("#email").fadeOut("fast").delay(500).slideUp("fast", function() {
// Submit form to PHP script
$("#done").fadeIn("slow").delay(500).slideDown("slow", function() {
});
});
});
});
});
});
});
});
});
});
});
});
});
});
});
});
});
그래, 난이 정말 못생긴 실현,하지만 난 그것을 할 다른 방법을 몰라? 누구든지 더 좋은 방법을 추천 할 수 있습니까?
당신이 그것을 옆으로 돌리면 그것은 그것이 얼마나 멋진가에 대한 그래프입니다. 조금 뾰족한 것 같아. –
그게 바로 콜백 액션입니다. jQuery.Deferred()를 살펴볼 수 있습니다. – j08691
제출 링크를 재정렬하고 이런 종류의 레이아웃을 사용해야합니까? [this]의 Jquery Code (http://webexpedition18.com/articles/how-to-create-a-multi-step-signup-form-with-css3-and-jquery)를 참조하십시오! 그것은 당신이 원하는 것입니까? – XhkUnlimit