vanila Javascript (3) 썸네일형 리스트형 [vanila Javascript] setsetInterval 활용 순차적 클래스 추가, 제거 See the Pen Untitled by JuYoung Lee (@juyoung-lee) on CodePen. 1. 무한반복 //2.5초 간격으로 moveNextList 실행 setInterval(moveNextList, 2500); const animateList = document.querySelectorAll('.animate-list li'); const animateListLength = animateList.length; // li갯수 let crrentIndex = 0; //현재 인덱스 값 animateList[crrentIndex].classList.add('active'); //초기화 function moveNextList () { //다음 인덱스 = (현재인덱스 +1) / 4(li 갯.. [프론트개발] Json 응답, 요청 처리 function getCampaignInfo() { const promotion_uuid = 'PMT-D6AFE6BA-7D04-5939-2D97-61843A9584E2'; // 통신에 사용될 XMLHttpRequest 객체 const httpRequest = new XMLHttpRequest(); // Post 방식으로 요청 httpRequest.open("POST", `${baseApiUrl}event/custom/get`, true); // Response Type을 Json으로 사전 정의 httpRequest.responseType = 'json'; //정의된 서버에 Json 형식의 요청 Data를 포함하여 요청을 전송 httpRequest.send(JSON.stringify({'promotion_.. [javascript] 스크롤에 따라 나타나고 사라지는 헤더 (모바일웹/웹뷰) [HTML] header section1 section2 section3 section4 [CSS] * {margin:0; padding: 0;} body { width: 360px; } header { position: absolute; left: 0; top: 0; width: 360px; height: 100px; font-weight: 800; line-height: 100px; text-align: center; background-color: #fff; opacity:0; } header.fade.fixed { position: fixed; opacity:1; z-index: 100; border: 1px solid #333; -webkit-transition: all 0.8s ease; -m.. 이전 1 다음