Keyframes in FF aber nich in Chrome

04/11/2013 11:00 Fusselchön#1
Hi, ich hab ein Problem, meine Keyframeanimation wird im FF angezeigt, aber im Chrome geht sie gar nicht. Im IE geht sie nur halb (Das Laden am Anfang geht, danach nichtsmehr)

Hier der Code:
HTML:
Code:
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<ul id="portfolio">
  <li>
    <div class="card"></div>
    <img src="http://lorempixel.com/300/200/people" alt="pic" />
    <div class="back">
      <h2>Johan van Tongeren</h2>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
    </div>
  </li>
  <li>
    <div class="card"></div>
    <img src="http://lorempixel.com/300/200/abstract" alt="pic" />
    <div class="back">
      <h2>Johan van Tongeren</h2>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
    </div>
  </li>
  <li>
    <div class="card"></div>
    <img src="http://lorempixel.com/300/200/technics/" alt="pic" />
    <div class="back">
      <h2>Johan van Tongeren</h2>
      <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer.</p>
    </div>
  </li>
</ul>
</body>
</html>
CSS:
Code:
body {
  background-color: lightblue;
  background-image: linear-gradient(top, rgba(255,255,255,.6) 0%, transparent 100%);
  background-repeat: no-repeat;
  padding: 50px;
}
a { color: hotpink; }
#portfolio {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 1060px;
}
#portfolio li {
  display: inline-block;
  margin-right:30px;
  position: relative;
  perspective: 600px;
  width: 320px;
  height: 220px;
}
#portfolio li img,
#portfolio li .back {
  position: absolute;
  left: 10px;
  top: 10px;
}
#portfolio .card {
  background: rgba(255,255,255,.7);
  width: 300px;
  height: 200px;
  padding: 10px;
  border: 1px solid #999;
  border-radius: 3px;
  z-index: 2;
  position: absolute;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
#portfolio li img {
  z-index: 3;
  animation: showMe 1s;
}
#portfolio li .back {
  width: 300px;
  height: 200px;
  overflow: hidden;
  z-index: 2;
  animation: hideMe 1s;
  text-shadow: 0 1px #FFF;
}
#portfolio h2 {
   margin: 0 0 .5em 0; 
  padding-bottom: .5em;
  border-bottom: 1px solid #999;
}
#portfolio li:hover img {
  animation: hideMe 1s;
  animation-fill-mode: forwards;
}
#portfolio li:hover .back {
  animation: showMe 1s;
  animation-fill-mode: forwards;
}
@keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}
@keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
04/11/2013 11:27 マルコ#2
Benutzt du die neusten Versionen der Browser? Ältere Versionen könnten dieses CSS3 Feature noch nicht (vollständig) implementiert haben.
04/11/2013 11:43 Fusselchön#3
Google Chrome ist auf dem neuesten Stand.

Jap habe ich =)
04/11/2013 13:17 Synatex#4
Probiers mal mit dem Engine-Präfix: @-webkit-keyframes
04/11/2013 13:45 CracyCrazz#5
Wie Synatex bereits erwähnte, nutz die Präfixes.


HTML Code:
@-webkit-keyframes show {
	0%{opacity: 0; z-index:1; display: none;}
    25%{opacity: 0.25; z-index: 1; display: block;}
    50%{opacity: 0.5; z-index: 1; display: block;}
    75%{opacity: 0.75; z-index: 1; display: block;}
	100%{ opacity: 1; z-index:2; display: block;}
}
@-moz-keyframes show {
	0% {  opacity: 0; z-index:1; display: none;}
    25%{opacity: 0.25; z-index: 1; display: block;}
    50%{opacity: 0.5; z-index: 1; display: block;}
    75%{opacity: 0.75; z-index: 1; display: block;}	
	100%{ opacity: 1; z-index:2; display: block;}
}
@-o-keyframes show {
	0% {  opacity: 0; z-index:1; display: none;}	
    25%{opacity: 0.25; z-index: 1; display: block;}
    50%{opacity: 0.5; z-index: 1; display: block;}
    75%{opacity: 0.75; z-index: 1; display: block;}	
	100%{ opacity: 1; z-index:2; display: block;}
}
@keyframes show {
	0% {  opacity: 0; z-index:1; display: none;}	
    25%{opacity: 0.25; z-index: 1; display: block;}
    50%{opacity: 0.5; z-index: 1; display: block;}
    75%{opacity: 0.75; z-index: 1; display: block;}	
	100%{ opacity: 1; z-index:2; display: block;}
}
Das Beispiel nutz ich derzeit für ne Slideshow und funktioniert in allen aktuellen, bekannten modernen Browsern.
04/11/2013 13:50 Fusselchön#6
Code:
@-webkit-keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}
@-moz-keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}
@-o-keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}
@keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}


@-webkit-keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
@-moz-keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
@-o-keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
@keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
Sieht jetz so aus, geht aber trotzdem nicht :/
04/11/2013 14:33 CracyCrazz#7
Oh, ich hab vergessen zu erwähnen das du dann noch,

Code:
	-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
	-ms-animation-fill-mode: forwards;
	-o-animation-fill-mode: forwards;
	animation-fill-mode: forwards;
Die jeweiligen Präfixes für die jeweiligen Browser in der Animation angeben musst, genauso wie du beim animation-name auch den Namen eingeben musst.

Code:
.hide {
	-webkit-animation-name: hide;
	-moz-animation-name: hide;
	-o-animation-name: hide;
	animation-name: hide;
    display: none;
}
Beides auszüge aus einer meiner CSS Dateien.
04/11/2013 14:47 Fusselchön#8
Code:
body {
  background-color: lightblue;
  background-image: linear-gradient(top, rgba(255,255,255,.6) 0%, transparent 100%);
  background-repeat: no-repeat;
  padding: 50px;
}
a { color: hotpink; }
#portfolio {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 1060px;
}
#portfolio li {
  display: inline-block;
  margin-right:30px;
  position: relative;
  perspective: 600px;
  width: 320px;
  height: 220px;
}
#portfolio li img,
#portfolio li .back {
  position: absolute;
  left: 10px;
  top: 10px;
}
#portfolio .card {
  background: rgba(255,255,255,.7);
  width: 300px;
  height: 200px;
  padding: 10px;
  border: 1px solid #999;
  border-radius: 3px;
  z-index: 2;
  position: absolute;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
#portfolio li img {
  z-index: 3;
  animation: showMe 1s;
}
#portfolio li .back {
  width: 300px;
  height: 200px;
  overflow: hidden;
  z-index: 2;
  animation: hideMe 1s;
  text-shadow: 0 1px #FFF;
}
#portfolio h2 {
   margin: 0 0 .5em 0; 
  padding-bottom: .5em;
  border-bottom: 1px solid #999;
}
#portfolio li:hover img {
  -webkit-animation-name: hideMe 1s;
   -moz-animation-name: showMe 1s;
	  -o-animation-name: showMe 1s;
	    animation-name: showMe 1s;
		
-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
	-ms-animation-fill-mode: forwards;
	-o-animation-fill-mode: forwards;
	animation-fill-mode: forwards;
}
#portfolio li:hover .back {
  -webkit-animation-name: showMe 1s;
    -moz-animation-name: showMe 1s;
	  -o-animation-name: showMe 1s;
	    animation-name: showMe 1s;
		
-webkit-animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
	-ms-animation-fill-mode: forwards;
	-o-animation-fill-mode: forwards;
	animation-fill-mode: forwards;
}


@-webkit-keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}
@-moz-keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}
@-o-keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}
@keyframes hideMe {
  0% { transform: translateY(0px); z-index 3; }
  49% { z-index: 3; -webkit-filter: blur(3px); }
  50% { transform: translateY(230px) rotateX(20deg); z-index: 2; }
  51% { z-index: 1; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(4px) grayscale(1); }
}


@-webkit-keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
@-moz-keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
@-o-keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
@keyframes showMe {
  0% { transform: translateY(0px); z-index: 1;-webkit-filter: blur(3px) grayscale(1); }
  49% { z-index: 1;  }
  50% { transform: translateY(-230px) rotateX(-20deg); z-index: 2; }
  51% { z-index: 3; -webkit-filter: blur(3px) grayscale(0);}
  100% { transform: translateY(0px); z-index: 3; }
}
Hab das ganze jetz so interpretiert.
Geht aber immer noch nicht, leider.
Aber danke schonmal für eure mühen.
04/11/2013 14:59 CracyCrazz#9
So wie du es interpretiert hast ist es falsch.

Du gibst beim "animation-name" eine Dauer von 1 Sekunde an. Dafür gibts "animation-duration: 1s;" mit den jeweiligen Präfixes davor. Des weiteren würde ich für die die animation-fill-mode Dinge ect. ne Klasse anlegen und die dann einfach zuweisen.

Ich geb dir jetzt einfach mal nen [Only registered and activated users can see links. Click Here To Register...] zu dem kompletten Ausschnitt der CSS Datei, vllt. verstehst du es dann etwas besser.
04/11/2013 15:08 Fusselchön#10
Danke dir, hat geklappt =)