UnHumbleBen / benjaminllee

Personal Website: (old link: https://csiflabs.cs.ucdavis.edu/~benlee12/)
https://unhumbleben.github.io/benjaminllee
0 stars 0 forks source link

Get ScrollSpy to work when window is resized #8

Open UnHumbleBen opened 3 years ago

UnHumbleBen commented 3 years ago

Currently when window is resized, ScrollSpy does not recalculate proper offsets. Make it so that ScrollSpy recalculate offsets properly on resize.

Idea: Apply hotfix on resize

UnHumbleBen commented 3 years ago

Update: The idea of applying hotfix on resize event handler doesn't work. Seems like somehow, multiple Scrollspy instances are being created. The hotfix fixes offsets for one of the instances, but the other instnace(s?) still have incorrect offsets and for some reason, ScrollSpy will choose to use these instances.

Why there are multiple instances in the first place is not clear. Why one instance would take precedent when the hotfix is applied, and then a separate instance is used after hotfix function is completed is also not clear.