You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
最近在学习Scrollbar,关于请教Ratio,offsetRatio计算公式的意义。
const offsetRatio = computed(
() =>
// offsetRatioX = original width of thumb / current width of thumb / ratioX
// offsetRatioY = original height of thumb / current height of thumb / ratioY
// instance height = wrap height - GAP
instance.value![bar.value.offset] ** 2 /
scrollbar.wrapElement![bar.value.scrollSize] /
props.ratio /
thumb.value![bar.value.offset]
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Feature type:
Other
Details
scrollbar
Description
最近在学习Scrollbar,关于请教Ratio,offsetRatio计算公式的意义。
const offsetRatio = computed(
() =>
// offsetRatioX = original width of thumb / current width of thumb / ratioX
// offsetRatioY = original height of thumb / current height of thumb / ratioY
// instance height = wrap height - GAP
instance.value![bar.value.offset] ** 2 /
scrollbar.wrapElement![bar.value.scrollSize] /
props.ratio /
thumb.value![bar.value.offset]
)
ratioY.value =
originalHeight /
(offsetHeight - originalHeight) /
(height / (offsetHeight - height))
Additional comments
请求大佬指导
Beta Was this translation helpful? Give feedback.
All reactions