How do I animate a scale css property using jquery? How do I animate a scale css property using jquery? javascript javascript

How do I animate a scale css property using jquery?


You can perform the transition using CSS and then just use Javascript as the 'switch' which adds the class to start the animation. Try this:

$('button').click(function() {  $('.bubble').toggleClass('animate');})
.bubble {  transform: scale(0);  width: 250px;  height: 250px;  border-radius: 50%;  background-color: #C00;  transition: all 5s;}.bubble.animate {  transform: scale(1);}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><button>Toggle</button><div class='col-lg-2 col-md-2 well bubble'></div>