게시글
질문&답변
2021.04.06
뭐가 문제일까요 ㅠㅠ
여기서 문제가 있나요 ?
- 1
- 5
- 1.1K
질문&답변
2021.04.06
뭐가 문제일까요 ㅠㅠ
const main = document.querySelector("#main"); const qna = document.querySelector("#qna"); const result = document.querySelector("#result"); const endPoint = 12; const select = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; function calResult(){ var result = select.indexOf(Math.max(...select)); return result; } function setResult(){ let point = calResult(); const resultName = document.querySelector('.resultname'); resultName.innerHTML = infoList[point].name; var resultImg = document.createElement('img'); const imgDiv = document.querySelector('#resultImg'); var imgURL = 'img/image-' + point + '.png'; resultImg.src = imgURL; resultImg.alt = point; resultImg.classList.add('img-fluid'); imgDiv.appendChild(resultImg); const resultDesc = document.querySelector('.resultDesc'); resultDesc.innerHTML = infoList[point].desc; } function setResult(){ let point = calResult(); const resultName = document.querySelector('.resultname'); resultName.innerHTML = infoList[point].name; var resultImg = document.createElement('img') const imgDiv = document.querySelector('#resultImg'); var imageUrl = 'img/image-' + point + '.png'; resultImg.src = imageUrl; resultImg.alt = point imgDiv.appendChild(resultImg); const resultDesc = document.querySelector('.resultDesc'); resultDesc.innerHTML = infoList[point].desc; } function goResult(){ qna.style.WebkitAnimation = "fadeOut 1s"; qna.style.animation = "fadeOut 1s"; setTimeout(() => { result.style.WebkitAnimation = "fadeIn 1s"; result.style.animation = "fadeIn 1s"; setTimeout(() => { qna.style.display = "none"; result.style.display = "block" }, 450)}) console.log(select); calResult(); } function addAnswer(answerText, qIdx, idx){ var a = document.querySelector('.answerBox'); var answer = document.createElement('button'); answer.classList.add('answerList'); answer.classList.add('my-3'); answer.classList.add('py-3'); answer.classList.add('mx-auto'); answer.classList.add('fadeIn'); a.appendChild(answer); answer.innerHTML = answerText; answer.addEventListener("click", function(){ var children = document.querySelectorAll('.answerList'); for(let i = 0; i children[i].disabled = true; children[i].style.WebkitAnimation = "fadeOut 0.5s"; children[i].style.animation = "fadeOut 0.5s"; } setTimeout(() => { var target = qnaList[qIdx].a[idx].type; for(let i = 0; i select[target[i]] += 1; } for(let i = 0; i children[i].style.display = 'none'; } goNext(++qIdx); },450) }, false); } function goNext(qIdx){ if(qIdx === endPoint){ goResult(); return; } var q = document.querySelector('.qBox'); q.innerHTML = qnaList[qIdx].q; for(let i in qnaList[qIdx].a){ addAnswer(qnaList[qIdx].a[i].answer, qIdx, i); } var status = document.querySelector('.statusBar'); status.style.width = (100/endPoint) * (qIdx+1) + '%'; } function begin(){ main.style.WebkitAnimation = "fadeOut 1s"; main.style.animation = "fadeOut 1s"; setTimeout(() => { qna.style.WebkitAnimation = "fadeIn 1s"; qna.style.animation = "fadeIn 1s"; setTimeout(() => { main.style.display = "none"; qna.style.display = "block" }, 450) let qIdx = 0; goNext(qIdx); }, 450); }
- 1
- 5
- 1.1K
질문&답변
2021.04.06
뭐가 문제일까요 ㅠㅠ
이제는 그냥 값이 출력이 되는거도 없네요 ㅋㅋㅋ
- 1
- 5
- 1.1K
질문&답변
2021.04.04
뭐가 문제죠 ㅠㅠ
그리고 계속 fadeIn fadeOut를 정상적으로 작성했음에도 불구하고 계속 그냥 딱딱하게 넘어가는데 이건 왜 그럴까요 ㅠ
- 2
- 6
- 475
질문&답변
2021.04.04
뭐가 문제죠 ㅠㅠ
4분 50초 쯤에 시작하기 버튼을 눌러 넘어가는게 안되요 ! 뭐가 문제인지를 모르겠어요 ㅠ
- 2
- 6
- 475
질문&답변
2021.04.04
뭐가 문제죠 ㅠㅠ
start.js const main = document.querySelector("#main"); const qna = document.querySelector("#qna"); function begin(){ main.style.WebkitAnimation = "fadeOut 1s"; main.style.animation = "fadeOut 1s"; qna.style.WebkitAnimation = "fadeIn 1s"; qna.style.animation = "fadeIn 1s"; //main.style.display = "none"; //qna.style.display = "block"; }
- 2
- 6
- 475
질문&답변
2021.04.04
뭐가 문제죠 ㅠㅠ
index.html 십이로 알아보는 연애유형 (사진) 나만의 MBTI 사이트입니다! 시작하기 버튼을 누르면 시작합니다. 시작하기 test!
- 2
- 6
- 475