Poorna Chandu Gade
Poorna Chandu Gade

Reputation: 13

CSS transition doesn't work properly in Chrome

My CSS transition doesn't work properly in Chrome. It is giving a blur effect in Chrome but works fine in Firefox.

Here is the code snippet for circle animation. I recommend viewing this in Chrome and at the maximum width of your screen.

Here is the HTML:

<button>Inflate!</button>
<div class='bubble'></div>

CSS:

.bubble {
  position: relative;
  left: 50px;
  top: 20px;
  transform: scale(1);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #C00;
  transition-origin: center;
  transition: all 0.5s;
  overflow: hidden;
}

.bubble.animate {
  transform: scale(30);
}

.bubble.ani {
  transform: scale(1);
}

JavaScript (jQuery):

$('button').click(function() {
  $('.bubble').addClass('animate');
});

$('.buuble').click(function() {
  $(this).removeClass('animate');
  $(this).addClass('ani');
});

Upvotes: 1

Views: 2891

Answers (1)

Sudhir Kaushik
Sudhir Kaushik

Reputation: 166

You are almost there my dear friend. Checked this pen on my veriosn of Chrome, works like a charm.

However, I suggest you to deep dive into Vendor specific CSS properties when working on CSS Transitions and Transformations.

Here are some links which will definitely work for you:

Cross browser Transitions : https://css-tricks.com/almanac/properties/t/transition/

.example {
    -webkit-transition: background-color 500ms ease-out 1s;
    -moz-transition: background-color 500ms ease-out 1s;
    -o-transition: background-color 500ms ease-out 1s;
    transition: background-color 500ms ease-out 1s;
}

Cross browser Transformations: https://css-tricks.com/almanac/properties/t/transform/

.element {
      -webkit-transform: value;
      -moz-transform:    value;
      -ms-transform:     value;
      -o-transform:      value;
      transform:         value;
    }

Upvotes: 1

Related Questions