D
D
Dmitry2014-03-24 18:21:22
css
Dmitry, 2014-03-24 18:21:22

Animation: Enlarge circle (div) with CSS - how to do it?

My task is to make an increasing circle on the site. More precisely, it is necessary that an image appear on the page using a circle animation. Those. if I did it on flash, then I would put a picture on the bottom layer, and a circle mask on the top layer, and enlarge this circle. Thus, it would turn out that the picture becomes visible by increasing the area of ​​the circle through which this picture is visible.

The idea was this: I make divs with rounded corners, i.e. a circle. As a background, I put a picture. Then I use animation to make the circle bigger, making the background more and more visible as the circle gets bigger. Implemented this using jQuery, everything turned out great test.ru.2139.vps.agava.net/spectr/index.phpwith the exception that in some browsers the background twitches a bit during the animation. The solution is jsfiddle.net/battrack/2L98G

Then I was told how to do it with pure CSS and it turned out to be jsfiddle.net/battrack/LZ4TM/4 .

But the problem is that if an image is placed on the background of this circle, then it increases along with the circle, which is unacceptable. And how to make the circle not pulsate? Those. to grow and freeze?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
Y
Yuri Lobanov, 2014-03-24
@iiil

jsfiddle.net/iiil/fgCmb/2 there are
a lot of options.

R
Roman Yakushev, 2014-03-24
@CanVas

as an option - place the image not inside the circle, but on the background of the circle.

A
AndeyValerevich, 2014-03-24
@AndeyValerevich

I'm not entirely sure, but why don't you nest the div from your first choice in a div with a fixed (final) width*height?

A
AndeyValerevich, 2014-03-24
@AndeyValerevich

Nothing new. Just dabbled in jsfiddle.net/C9X2S/2/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question