[Algorithm] Stack 알고리즘

스택 알고리즘


문제 스택 (stack)은 기본적인 자료구조 중 하나로, 컴퓨터 프로그램을 작성할 때 자주 이용되는 개념이다. 스택은 자료를 넣는 (push) 입구와 자료를 뽑는 (pop) 입구가 같아 제일 나중에 들어간 자료가 제일 먼저 나오는 (LIFO, Last in First out) 특성을 가지고 있다.

Continue reading

[Interactive] scrollTop 스크롤 진행 바 나타내기

스크롤 바로 진행 상황 확인


    let bar;
    let scrollTop = 0;
    window.onload = function() {
        bar = document.getElementsByClassName("bar")[0];
            
        window.addEventListener("scroll",function(e){
            scrollTop = document.documentElement.scrollTop;
            let per = Math.round(scrollTop / (document.body.scrollHeight - window.innerHeight) * 100);
            console.log(window.innerHeight);
            //console.log(bar)
            bar.style.height = per + "%";
        }, false)
    }

Continue reading

Pagination


© 2020.09. by Zeeen

Powered by jin-hw