CSS transition doesn't work properly in Chrome

筅森魡賤 提交于 2019-12-11 06:19:51

问题


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');
});

回答1:


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;
    }


来源:https://stackoverflow.com/questions/41470958/css-transition-doesnt-work-properly-in-chrome

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!