set_scroll_height

매번 하기 구찮으니까 좀 써놓자.

$.offset = el => {
const rect = el.getBoundingClientRect();
return {
top: rect.top + window.pageYOffset – document.documentElement.clientTop,
left: rect.left + window.pageXOffset – document.documentElement.clientLeft
};
};
const set_scroll_height = (target, container, option_height) => {
container.scrollTo(0, $.offset(target).top – option_height);
};

Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
모든 댓글 보기
0
생각을 나눠주시면 감사해요!x
()
x
Please enter Google Username or ID to start!
Example: clip360net or 116819034451508671546
Title
Caption
File name
Size
Alignment
Link to
  Open new windows
  Rel nofollow