<!-- 앱 바디 -->
<div class="app-body">
<!-- 헤더 -->
<header></header>
<!-- //헤더 -->
<!-- 하나의 페이지 -->
<div id="PageHome" class="app-page" style="left:0;display:block;"></div>
<!-- //하나의 페이지 -->
<!-- 헤더 -->
<footer></footer>
<!-- //헤더 -->
</div>
<!-- //앱 바디 -->
/* 앱바디 */
.app-body { position: relative; width: 100%; margin: 0 auto; height: 100vh; background-color: #2f2f2f; }
/* 앱 페이지 */
.app-page { position: absolute; display: none; left: -100%; top: 0; width: 100%; }
var proc = true;
var pageInfo = {
Status: "PageHome",
Previous: "",
Speed: 300
};
function fnPageMotion(targetID, navPos) {
console.log(targetID);
if (document.getElementById(targetID) !== null) {
if (pageInfo.Status !== targetID) {
if (proc) {
proc = false;
let PreviousPage = $("#" + pageInfo.Status);
let NextPage = $("#" + targetID);
NextPage.css({ "display": "block", "left": screen.width }).promise().done(function () {
PreviousPage.animate({ "left": "-100%" }, pageInfo.Speed, function () {
pageInfo.Previous = PreviousPage.attr("id");
PreviousPage.css({ "left": "100%", "display": "none" });
});
NextPage.animate({ "left": "0" }, pageInfo.Speed, function () {
allnavErase();
$("#" + navPos).addClass("active");
pageInfo.Status = targetID;
proc = true;
});
});
}
}
}
}
'프론트엔드' 카테고리의 다른 글
[IIS] 허용할 확장자 추가하는 방법 (MIME) (0) | 2021.04.28 |
---|---|
.cshtml 한글깨짐 현상 해결방법 (0) | 2021.04.07 |
[추천사이트] Word to HTML (aka text to html) (0) | 2021.03.18 |
[테이블 코딩]테이블 커스텀할 시 참고할 문서 (0) | 2021.03.06 |
[추천사이트 모음] 웹퍼블리싱 실무 추천사이트 (뷰티파이, 미니파이, 바벨 ...) (0) | 2021.03.05 |