출처 : http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app/

핵심은

$(window).scroll(
        function ()
        {
            if($(window).scrollTop() > $("#content").position().top + 20){
                $("#tableOfContents").css("position", "fixed");
                var marginTop = 20;// - $("#content").height();
                /*$("#tableOfContents").css("margin-top", marginTop + "px");*/
                $("#tableOfContents").css("top", "0");
            }else{
                $("#tableOfContents").css("position", "static");
                $("#tableOfContents").css("margin-top", "20px");
          }
        }
    );

이부분
Posted by 삽지리
,