【问题标题】:Animation not working on Chrome [duplicate]动画在 Chrome 上不起作用 [重复]
【发布时间】:2016-10-15 03:08:36
【问题描述】:

我在一个 div 的背景上做了一个缩放效果。 直到今天它停止为 Chrome 运行时,所有这些都有效。对于其他所有浏览器,它都能完美运行。

这是我的代码:

.project_image {
    width: 582px;
    height: 280px;
    background-position: center;
    -webkit-transition: all .2s linear;
    -moz-transition: all .2s linear;
    -o-transition: all .2s linear;
    -ms-transition: all .2s linear;
    transition: all .2s linear;
    background-size: 100%;
}

.project_image:hover {
	background-size: 110%;
}

在 Chrome 上,当我将 div 悬停时,背景大小会立即设置为 110%,而不是像想要的那样缓慢。

编辑:小提琴https://jsfiddle.net/ca79cohz/

【问题讨论】:

  • 为您的代码创建一个有效的 jsfiddle,这不起作用。
  • css 对我来说很好用,我在 chrome、IE 和 firefox 中测试过……都一样
  • 我用小提琴更新了帖子,对我来说不起作用,chrome 51.0.2704.84 m
  • 这是工作编辑的 JS 小提琴:jsfiddle.net/ca79cohz/1

标签: css google-chrome animation


【解决方案1】:

添加此更改,

.project_image {
background-size: 100% 100%;
}
.project_image:hover {
background-size: 110% 110%;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-12
    • 2016-09-04
    • 2013-02-24
    • 2014-04-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多