mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-01 08:18:05 +09:00
Fix stickyTop calculation
This commit is contained in:
parent
20dc72691b
commit
299749480a
@ -6,7 +6,7 @@ export default {
|
|||||||
|
|
||||||
const header = src.children[0];
|
const header = src.children[0];
|
||||||
const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop') || '0px';
|
const currentStickyTop = getComputedStyle(src).getPropertyValue('--stickyTop') || '0px';
|
||||||
src.style.setProperty('--stickyTop', `${parseInt(currentStickyTop) + header.offsetHeight}px`);
|
src.style.setProperty('--stickyTop', `calc(${currentStickyTop} + ${header.offsetHeight}px)`);
|
||||||
header.style.setProperty('--stickyTop', currentStickyTop);
|
header.style.setProperty('--stickyTop', currentStickyTop);
|
||||||
header.style.position = 'sticky';
|
header.style.position = 'sticky';
|
||||||
header.style.top = 'var(--stickyTop)';
|
header.style.top = 'var(--stickyTop)';
|
||||||
|
Loading…
Reference in New Issue
Block a user