How to simulate magnifying glass on Web-page image (Javascript)?

前端 未结 6 2009
一整个雨季
一整个雨季 2020-12-05 11:16

Google has the coolest effects - once it was a Pac-man game, today is apparently the 160th anniversary of the first World Fair, and Google\'s logo has an image of i

6条回答
  •  感情败类
    2020-12-05 11:45

    I don't know how Google does it, since the logo is no longer showing in my area; but this effect can be achieved by clipping the enlarged animated GIF over the regular image using canvas. Alternatively, it is also possible to create create a circular clipping using CSS border-radius (commonly used to implement rounded corners).

    EDIT: I've hacked this up together to show the basic technique that you need if you used CSS border-radius: http://jsfiddle.net/yjBuS/

提交回复
热议问题