David
David

Reputation: 1963

CSS3 fade background image animation - Firefox

Ok, so I have this example:

http://jsfiddle.net/2uux3jh7/

It works fine on Chrome, but it does not in Firefox. Anyone know why?

HTML uses only one div with .front class. Here's the code for CSS:

.front {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: static;
  -webkit-animation: fading 3s infinite;
  animation: fading 3s infinite;
  -webkit-animation-direction: alternate;
  animation-direction: alternate;
  font-size: 1em;
  -webkit-font-smoothing: subpixel-antialiased;
  text-shadow: 0 0 1px rgba(0,0,0,0.3);
  -webkit-text-stroke: 1px transparent;
}

@-webkit-keyframes fading {
  0%, 35%   { background-image: url('http://khongthe.com/wallpapers/people/pretty-woman-65379.jpg'); }
  65%, 100%  { background-image: url('http://www.inspiringwomen.co.za/wp-content/uploads/2010/08/happy-woman-hd-1080p-wallpapers-download.jpg'); }
}

@keyframes fading {
  0%, 35%   { background-image: url('http://khongthe.com/wallpapers/people/pretty-woman-65379.jpg'); }
  65%, 100%  { background-image: url('http://www.inspiringwomen.co.za/wp-content/uploads/2010/08/happy-woman-hd-1080p-wallpapers-download.jpg'); }
}

@-moz-keyframes fading {
  0%, 35%   { background-image: url('http://khongthe.com/wallpapers/people/pretty-woman-65379.jpg'); }
  65%, 100%  { background-image: url('http://www.inspiringwomen.co.za/wp-content/uploads/2010/08/happy-woman-hd-1080p-wallpapers-download.jpg'); }
}

Upvotes: 1

Views: 3468

Answers (1)

user2987016
user2987016

Reputation: 101

Unfortunately, Firefox can’t transition background-image.. So you have to do it another way.

Here is another stackoverfow question related to your problem, with some alternatives. : CSS3 background image transition

Upvotes: 1

Related Questions