🕹 스크립트

스크롤 따라다니는 SNB

(。θᗨθ。) 2022. 3. 15. 16:24

See the Pen Untitled by publisher-jy (@publisher-jy) on CodePen.

let snbPosition = parseInt($(".event main .snb").css("top"));
  $(window).scroll(function () {
    let st = $(window).scrollTop();
    $(".event main .snb")
      .stop()
      .animate({ top: st + snbPosition + "px" }, 500); //여기선 고정
  });

 

728x90