Efficient HTML Div with hole in it

前端 未结 5 949
日久生厌
日久生厌 2021-01-20 20:32

Let me explain a bit more, I am trying to have a large area (full screen) with a fixed size hole in it. The hole will follow the mouse around the screen. Think of having a

5条回答
  •  有刺的猬
    2021-01-20 20:39

    Conclusions:

    • Having 4 divs and resizing them appears to be the fastest approach
    • Moving 4 divs is 4x slower
    • Moving 1 container div w/ 4 inner divs is just as slow (4x slower than resizing)
    • Using background-images is the only option that IE supports (as opacity filter (alpha) is too slow for whole page size divs).
    • background-image has to be solid (i.e. 1px solid colour with semi-opacity). Trying to get a solid color / semi-opaque color to achieve blur will cause screen repaint artifacts (even when not resizing/moving) divs.

提交回复
热议问题