Efficient HTML Div with hole in it

前端 未结 5 1181
日久生厌
日久生厌 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:46

    1. Have one div which is twice as wide and twice as tall as the viewport.
    2. Inside that, put your four divs to create the fixed-width hole in the middle.
    3. In your javascript, make the outer div move around with the cursor, rather than resizing the four divs.

提交回复
热议问题