'Apply position: fixed style on many items
I have a div and inside it a map (using leaflet library) with icons (LIcon leaflet) as geographic markers. As the div has no specific CSS position it moves with srolling but when it reaches the border of the screen I stick it using
myMap.classList.add("sticky")
,the sticky class is
.sticky {
position: fixed;
}
Everything works well except when I have many markers, more than 100 for instance, when I apply the sticky style the map goes on scrolling with the page and so partially disappear and after the time of a blink goes to the specified fixed position. This time increases with the number of icons. and my guess is it takes time to the browser to cascade the fixed position to all icons. Is there a way to avoid this or at least minimize the time. I tried to apply specific CSS position styles to icons but no changes. Any idea?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
