How to add 1 more image and animation for this slider. please help me to change value property #-moz-keyframes{} or #-webkit-keyframes{}. thanks.
there my slider https://jsfiddle.net/JonoRecher/zt3d2duj/
/* MY CSS*/
#wrapper4 {
border-top: 7px solid #bdbdbd;
border-bottom: 7px solid #bdbdbd;
padding-top: 40px;
padding-bottom: 40px;
background-image: url(http://subtlepatterns2015.subtlepatterns.netdna-cdn.com/patterns/congruent_outline.png);
}
#slider4 {
background: #000;
border: 5px solid #eaeaea;
box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
height: 320px;
width: 680px;
margin: 0 auto 0;
overflow: visible;
position: relative;
}
#mask {
overflow: hidden;
height: 320px;
}
#slider4 ul {
margin: 0;
padding: 0;
position: relative;
}
#slider4 li {
width: 640px;
height: 320px;
position: absolute;
top: -325px;
list-style: none;
}
#slider4 li.animation1 {
animation: cycle 25s linear infinite;
}
#slider4 li.animation2 {
animation: cycle2 25s linear infinite;
}
#slider4 li.animation3 {
animation: cycle3 25s linear infinite;
}
#slider4 li.animation4 {
animation: cycle4 25s linear infinite;
}
#slider4 li.animation5 {
animation: cycle5 25s linear infinite;
}
#keyframes cycle {
0% {top: 0px;}
4% {top: 0px;}
16% {top: 0px;opacity: 1;z-index: 0;}
20% {top: 325px;opacity: 0;z-index: 0;}
21% {top: -325px;opacity: 0;z-index: -1;}
92% {top: -325px;opacity: 0;z-index: 0;}
96% { top: -325px;opacity: 0;}
100% {top: 0px;opacity: 1;}
}
#keyframes cycle2 {
0% {top: -325px;opacity: 0;}
16% {top: -325px;opacity: 0;}
20% {top: 0px;opacity: 1;}
24% {top: 0px; opacity: 1;}
36% {top: 0px; opacity: 1;z-index: 0;}
40% {top: 325px;opacity: 0;z-index: 0;}
41% {top: -325px;opacity: 0;z-index: -1;}
100% {top: -325px;opacity: 0;z-index: -1;}
}
#keyframes cycle3 {
0% {top: -325px;opacity: 0;}
36% {top: -325px;opacity: 0;}
40% {top: 0px;opacity: 1;}
44% {top: 0px;opacity: 1;}
56% {top: 0px;opacity: 1;}
60% {top: 325px; opacity: 0;z-index: 0;}
61% {top: -325px;opacity: 0;z-index: -1;}
100% {top: -325px;opacity: 0; z-index: -1;}
}
#keyframes cycle4 {
0% {top: -325px;opacity: 0;}
56% {top: -325px;opacity: 0;}
60% {top: 0px;opacity: 1;}
64% {top: 0px;opacity: 1;}
76% {top: 0px;opacity: 1;z-index: 0;}
80% {top: 325px;opacity: 0;z-index: 0;}
81% {top: -325px;opacity: 0;z-index: -1;}
100% {top: -325px;opacity: 0;z-index: -1;}
}
#keyframes cycle5 {
0% {top: -325px;opacity: 0;}
76% {top: -325px;opacity: 0;}
80% {top: 0px;opacity: 1;}
84% {top: 0px;opacity: 1;}
96% {top: 0px;opacity: 1;z-index: 0;}
100% {top: 325px;opacity: 0;z-index: 0;}
}
.progress-bar {
position: relative;
top: -5px;
width: 680px;
height: 5px;
background: #000;
animation: fullexpand 25s ease-out infinite;
}
#keyframes fullexpand {
0%, 20%, 40%, 60%, 80%, 100% {width: 0%;opacity: 0;}
4%,24%,44%,64%,84% {width: 0%;opacity: 0.3;}
16%,36%,56%,76%,96% {width: 100%;opacity: 0.7;}
17%,77%,97% {width: 100%;opacity: 0.3;}
18%,38%,58%,78%,{opacity: 0;}
}
#slider4 .tooltip {
background: rgba(0, 0, 0, 0.7);
width: 300px;
height: 60px;
position: relative;
bottom: 75px;
left: -320px;
transition: all 0.3s ease-in-out;
}
#slider4 .tooltip h1 {
color: #fff;
font-size: 24px;
font-weight: 300;
line-height: 60px;
padding: 0 0 0 10px;
}
#slider4 li#list1:hover .tooltip,
#slider4 li#list2:hover .tooltip,
#slider4 li#list3:hover .tooltip,
#slider4 li#list4:hover .tooltip,
#slider4 li#list5:hover .tooltip {
left: 0px;
}
#slider4:hover li,
#slider4:hover .progress-bar {
animation-play-state: paused;
}
<div id="wrapper4">
<div id="content-slider">
<div id="slider4">
<div id="mask">
<ul>
<li id="list1" class="animation1">
<img src="http://js.seocn.info/up_pic/js/201312/1533/images/img_1.jpg" alt="Couqar">
<div class="tooltip">
<h1>Couqar</h1>
</div>
</li>
<li id="list2" class="animation2">
<img src="http://js.seocn.info/up_pic/js/201312/1533/images/img_2.jpg" alt="Lions">
<div class="tooltip">
<h1>Lions</h1>
</div>
</li>
<li id="list3" class="animation3">
<img src="http://js.seocn.info/up_pic/js/201312/1533/images/img_3.jpg" alt="Snowalker">
<div class="tooltip">
<h1>Snowalker</h1>
</div>
</li>
<li id="list4" class="animation4">
<img src="http://js.seocn.info/up_pic/js/201312/1533/images/img_4.jpg" alt="Howling">
<div class="tooltip">
<h1>Howling</h1>
</div>
</li>
<li id="list5" class="animation5">
<img src="http://js.seocn.info/up_pic/js/201312/1533/images/img_5.jpg" alt="Sunbathing">
<div class="tooltip">
<h1>Sunbathing</h1>
</div>
</li>
</ul>
</div>
<div class="progress-bar"></div>
</div>
</div>
</div>
1. Update your html
Firstly, add a sixth li tag for your new image after the last li tag in your html as follows:
<!-- Provide a new value for 'id' and 'class' attributes and set the values as shown below -->
<li id="list6" class="animation6">
<!--
1. Add the path to your new image in the 'src' attribute of the `img` tag below.
2. Describe your new image in the 'alt' attribute of the `img` tag below.
3. Update the text in the `h1` tag below as required.
-->
<img src="/the/path/to/new/image" alt="Description goes here">
<div class="tooltip">
<h1>some new text goes here</h1>
</div>
</li>
2. Update your CSS
All of the animation keyframes should be updated to handle the 6th image.
Full example:
The complete revised code can be found here here.
NOTE: You just need to add the path to your new image in the img tags 'src' attribute (line 44 of the html):
Related
I've spent the past little while reading up on #keyframes and animation CSS (because honestly my coding skills were stuck mid naughties!) and while I understand how it works in theory my maths isn't working.
What I want is three items to fade in and out over 15 seconds so on an infinite loop.
Item 1 - opacity: 0 at 0% and opacity 1 at 33% then back to opacity 0 for the next 10 seconds (66% and 100%)
Item 2 - opacity: 0 at 0% and 33% before fading in to opacity 1 by 66% and then back out
Item 3 - opacity 0 for the first ten seconds and then fade in to opacity 1 by 99%/100%
The CSS that I have at the moment is
.testimonial-slider {
display: block;
width: 50%;
height: auto;
margin-top: 100px;
}
.testimonial-slider ul.slider {
display: block;
list-style: none;
padding: 0;
position: relative;
display: inline-block;
width: 100%;
height: 500px;
overflow: hidden;
margin: 0 auto;
}
.testimonial-slider ul.slider li {
position: absolute;
display: block;
width: 100%;
opacity: 0;
margin: 0 auto;
}
.testimonial-slider ul.slider li:nth-child(1) {
-webkit-animation: fade-animation-1 15s infinite;
animation: fade-animation-1 15s infinite;
}
.testimonial-slider ul.slider li:nth-child(2) {
-webkit-animation: fade-animation-2 15s infinite;
animation: fade-animation-2 15s infinite;
}
.testimonial-slider ul.slider li:nth-child(3) {
-webkit-animation: fade-animation-3 15s infinite;
animation: fade-animation-3 15s infinite;
.testimonial-slider q {
display: inline-block;
font: normal 30px Helvetica, Arial, Verdana, sans-serif;
letter-spacing: .5pt;
text-shadow: 0 5px 10px rgba(0,0,0,.1);
}
.testimonial-slider .source {
margin-top: 25px;
color: #fff;
font: italic 20px Helvetica, Arial, Verdana, sans-serif;
}
/* KEYFRAME DECLARATIONS */
#keyframes fade-animation 1 {
0% {opacity:0;}
33% {opacity:1;}
65% {opacity:0;}
100% {opacity:0;}
}
#keyframes fade-animation 2 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:1}
100% {opacity:0}
#keyframes fade-animation 3 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:0}
99% {opacity:1}
100% {opacity:0}
#-webkit-keyframes fade-animation-1 {
0% {opacity:0;}
33% {opacity:1;}
65% {opacity:0;}
100% {opacity:0;}
}
#-webkit-keyframes fade-animation-2 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:1}
100% {opacity:0}
#-webkit-keyframes fade-animation 3 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:0}
99% {opacity:1}
100% {opacity:0}
and the corresponding HTML
<div class="testimonial-slider" style="padding:5px;">
<ul class="slider">
<li>
<div class="testimonial-slider-content"> <q>Such a great testimonial goes here!!! Yay!!!.</q>
<p class="source">- Chair</p>
</div>
</li>
<li>
<div class="testimonial-slider-content"> <q>Testimonial 2 content oh yay great testimonial</q>
<p class="source">- Head of Investor Relations</p>
</div>
</li>
<li>
<div class="testimonial-slider-content"> <q>Testimonial content here
</q>
<p class="source">- CEO/Founder</p>
</div>
</li>
</ul>
</div>
So, your code is working fine. The only problem is that you don't have some curly brackets closed.
.testimonial-slider {
display: block;
width: 50%;
height: auto;
margin-top: 100px;
}
.testimonial-slider ul.slider {
display: block;
list-style: none;
padding: 0;
position: relative;
display: inline-block;
width: 100%;
height: 500px;
overflow: hidden;
margin: 0 auto;
}
.testimonial-slider ul.slider li {
position: absolute;
display: block;
width: 100%;
opacity: 0;
margin: 0 auto;
}
.testimonial-slider ul.slider li:nth-child(1){
-webkit-animation: fade-animation-1 15s infinite;
animation: fade-animation-1 15s infinite;
}
.testimonial-slider ul.slider li:nth-child(2) {
-webkit-animation: fade-animation-2 15s infinite;
animation: fade-animation-2 15s infinite;
}
.testimonial-slider ul.slider li:nth-child(3) {
-webkit-animation: fade-animation-3 15s infinite;
animation: fade-animation-3 15s infinite;
}
.testimonial-slider q {
display: inline-block;
font: normal 30px Helvetica, Arial, Verdana, sans-serif;
letter-spacing: .5pt;
text-shadow: 0 5px 10px rgba(0,0,0,.1);
}
.testimonial-slider .source {
margin-top: 25px;
color: #fff;
font: italic 20px Helvetica, Arial, Verdana, sans-serif;
}
/* KEYFRAME DECLARATIONS */
#keyframes fade-animation-1 {
0% {opacity:0;}
33% {opacity:1;}
65% {opacity:0;}
100% {opacity:0;}
}
#keyframes fade-animation-2 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:1}
100% {opacity:0}
}
#keyframes fade-animation-3 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:0}
99% {opacity:1}
100% {opacity:0}
}
#-webkit-keyframes fade-animation-1 {
0% {opacity:0;}
33% {opacity:1;}
65% {opacity:0;}
100% {opacity:0;}
}
#-webkit-keyframes fade-animation-2 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:1}
100% {opacity:0}
}
#-webkit-keyframes fade-animation-3 {
0% {opacity:0}
33% {opacity:0}
66% {opacity:0}
99% {opacity:1}
100% {opacity:0}
}
<div class="testimonial-slider" style="padding:5px;">
<ul class="slider">
<li>
<div class="testimonial-slider-content"> <q>Such a great testimonial goes here!!! Yay!!!.</q>
<p class="source">- Chair</p>
</div>
</li>
<li>
<div class="testimonial-slider-content"> <q>Testimonial 2 content oh yay great testimonial</q>
<p class="source">- Head of Investor Relations</p>
</div>
</li>
<li>
<div class="testimonial-slider-content"> <q>Testimonial content here
</q>
<p class="source">- CEO/Founder</p>
</div>
</li>
</ul>
</div>
Regards
I found a nice and simple automatic css slider (http://dreyacosta.github.io/pure-responsive-css3-slider/) but the problem is it shows only first 3 images one by one and then repeats them. How can I make it slide all images regardless how many I put in the list? Each image is 300px by 225px and I also want to keep its aspect ration regardless of a screen size.
.card-img-top {
height:auto;
width:100%;
display:block;
border-top-left-radius:calc(.25rem - 1px);
border-top-right-radius:calc(.25rem - 1px)
}
.slider {
padding: 0;
margin: 0 auto;
overflow: hidden;
max-width: 100%;
}
.slider ol {
width: 1000%;
height: auto;
position: relative;
display:block;
list-style: none;
left: 0;
margin: 0;
padding: 0;
line-height: 0;
-moz-animation:slide-animation 10s infinite;
-webkit-animation:slide-animation 10s infinite;
}
.slider ol:hover {
-moz-animation-play-state:paused;
-webkit-animation-play-state:paused;
}
.slider li {
width: 10%;
height: auto;
list-style: none;
float: left;
margin: 0;
padding: 0;
}
#-webkit-keyframes slide-animation {
1% {left: 0%; opacity: 1;}
18% {left: 0%; opacity: 1}
19% {opacity: 0.2;}
20% {left: -100%; opacity: 1;}
58% {left: -100%; opacity: 1;}
59% {opacity: 0.2;}
60% {left: -200%; opacity: 1;}
98% {left: -200%; opacity: 1;}
99% {opacity: 0.5;}
100% {left: 0%;}
}
#-moz-keyframes slide-animation {
1% {left: 0%; opacity: 1;}
18% {left: 0%; opacity: 1}
19% {opacity: 0.2;}
20% {left: -100%; opacity: 1;}
58% {left: -100%; opacity: 1;}
59% {opacity: 0.2;}
60% {left: -200%; opacity: 1;}
98% {left: -200%; opacity: 1;}
99% {opacity: 0.5;}
100% {left: 0%;}
}
<!-- Slideshow box -->
<div class="slider">
<ol>
<li><img src="http://www.maggitekstils.lv/img/pillowcases.jpg" class="card-img-top"></li>
<li><img src="http://www.maggitekstils.lv/img/pillowcases-curly-light.jpg" class="card-img-top"></li>
<li><img src="http://www.maggitekstils.lv/img/pillowcases-circles-pink.jpg" class="card-img-top"></li>
<li><img src="http://www.maggitekstils.lv/img/pillowcases-khaki.jpg" class="card-img-top"></li>
<li><img src="http://www.maggitekstils.lv/img/pillowcases-circles-blue.jpg" class="card-img-top"></li>
<li><img src="http://www.maggitekstils.lv/img/pillowcases-pink-violet.jpg" class="card-img-top"></li>
<li><img src="http://www.maggitekstils.lv/img/pillowcases-red-poppy.jpg" class="card-img-top"></li>
<li><img src="http://www.maggitekstils.lv/img/pillowcases-cacao.jpg" class="card-img-top"></li>
</ol>
</div>
<!--end-->
It's not a great slider tbh, but the 3 image limit is set through left:
#-webkit-keyframes slide-animation {
1% {left: 0%; opacity: 1;} // Slideshow is 0% to the left
18% {left: 0%; opacity: 1}
19% {opacity: 0.2;}
20% {left: -100%; opacity: 1;} // Slideshow is 100% to the left, so showing slide 2
58% {left: -100%; opacity: 1;}
59% {opacity: 0.2;}
60% {left: -200%; opacity: 1;} // Slideshow is 200% to the left, showing slide 3
98% {left: -200%; opacity: 1;}
99% {opacity: 0.5;}
100% {left: 0%;} // Slideshow is 0% to the left - back to start
}
You'd need to split into smaller increments to add -300% for slide 4, -400% for slide 5 etc.
I'm working on an app with Ionic framework and I'm still a novice in css. I created a images slider with timer and but the size of it is fixed. However, I would like to change it to be depends on the screen size and resolution.
This is the html content:
<ion-content>
<div class="container">
<div id="content-slider">
<div id="slider">
<div id="mask">
<ul>
<li id="first" class="firstanimation">
<a href=#><img src="../img/coffe_and_sweet_sale.jpg"/></a>
<div class="tooltip"><h1>text 1</h1></div>
</li>
<li id="second" class="secondanimation">
<img src="../img/pizza_sale.png"/>
<div class="tooltip"><h1>text 2</h1></div>
</li>
<li id="third" class="thirdanimation">
<img src="../img/sandwich_sale.jpg"/>
<div class="tooltip"><h1>text 3</h1></div>
</li>
</ul>
</div>
</div>
</div>
</div>
</ion-content>
In the
style.css
I did something like that:
#slider{
background: #000;
border: 5px solid #eaeaea;
box-shadow: 1px 1px 5px rgba(0,0,0,0.7);
height: 320px;
width: 680px;
margin: 40px auto 0;
overflow: visible;
position: relative;
}
#mask{
overflow: hidden;
height: 310px;
}
#slider ul{
margin: 0;
padding: 0;
position: relative;
}
#slider li{
width: 680px;
height: 320px;
position: absolute;
top: -325px;
list-style: none;
}
#slider img{
width: 680px;
height: 320px;
}
So now it shows the images perfectly but it it doesn't of course fit to any screen.
EDIT 1
I'm adding the style for the slider animation:
#slider li.firstanimation{
animation: cycle 24s linear infinite;
}
#slider li.secondanimation{
animation: cycletwo 24s linear infinite;
}
#slider li.thirdanimation{
animation: cyclethree 24s linear infinite;
}
#keyframes cycle{
0% {top: 0px;}
3.33% {top: 0px;}
26.64% {top:0px; opacity: 1; z-index: 0;}
29.97% {top: 325px; opacity: 0; z-index: 0;}
30.97% {top:-325px; opacity: 0; z-index: 0;}
93.34% {top:-325px; opacity: 0; z-index: 0;}
96.67% {top: -325px; opacity: 0; }
100% {top: 0px; opacity: 1;}
}
#keyframes cycletwo{
0% {top: -325px; opacity: 0;}
26.64% {top: -325px; opacity: 0}
29.97% {top:0px; opacity: 1;}
33.3% {top: 0px; opacity: 1;}
59.94% {top: 0px; opacity: 1; z-index: 0;}
63.27% {top: 325px; opacity: 0; z-index: 0;}
64.27% {top: -325px; opacity: 0; z-index: -1; }
100% {top: -325px; opacity: 0; z-index: -1;}
}
#keyframes cyclethree{
0% {top: -325px; opacity: 0;}
59.94% {top: -325px; opacity: 0;}
63.27% {top:0px; opacity: 1;}
66.6% {top: 0px; opacity: 1;}
93.24% {top: 0px; opacity: 1;}
96.57% {top: 325px; opacity: 0; z-index: 0;}
97.57% {top: -325px; opacity: 0; z-index: -1;}
100% {top: -325px; opacity: 0; z-index: -1;}
}
#slider .tooltip{
background: rgba(0,0,0,0.7);
width: 450px;
height; 60px;
position: relative;
bottom: 85px;
}
#slider .tooltip h1{
color: #fff;
font-size: 24px;
font-weight: 300;
line-height: 60px;
padding: 0 0 0 10px;
}
#slider .tooltip {
transition: all 0.3 ease-in-out;
}
I've added one media query for the height. Here's a link for mediaquery if you want to change something.
As for slider i've fixed the issue now between third and first slide there is a blank slide. I was not sure if it is by design or not. Hope you can fix it if needed.
#slider{
background: #000;
border: 5px solid #eaeaea;
box-shadow: 1px 1px 5px rgba(0,0,0,0.7);
height: 320px;
width: 80%;
max-width: 680px;
margin: 40px auto 0;
overflow: visible;
position: relative;
}
#mask{
overflow: hidden;
height: 310px;
}
#slider ul{
margin: 0;
padding: 0;
height: 320px;
width: inherit;
position: relative;
}
#slider a{
width: 100%;
height: 100%;
}
#slider li{
width: inherit;
height: 320px;
position: absolute;
top: 100px;
list-style: none;
}
#slider img{
width: 100%;
height: 320px;
}
#slider li.firstanimation{
animation: cycle 24s linear infinite;
}
#slider li.secondanimation{
animation: cycletwo 24s linear infinite;
}
#slider li.thirdanimation{
animation: cyclethree 24s linear infinite;
}
#keyframes cycle{
0% {top: 0px;}
3.33% {top: 0px;}
26.64% {top:0px; opacity: 1; z-index: 0;}
29.97% {top: 325px; opacity: 0; z-index: 0;}
30.97% {top:-325px; opacity: 0; z-index: 0;}
93.34% {top:-325px; opacity: 0; z-index: 0;}
96.67% {top: -325px; opacity: 0; }
100% {top: 0px; opacity: 1;}
}
#keyframes cycletwo{
0% {top: -325px; opacity: 0;}
26.64% {top: -325px; opacity: 0}
29.97% {top:0px; opacity: 1;}
33.3% {top: 0px; opacity: 1;}
59.94% {top: 0px; opacity: 1; z-index: 0;}
63.27% {top: 325px; opacity: 0; z-index: 0;}
64.27% {top: -325px; opacity: 0; z-index: -1; }
100% {top: -325px; opacity: 0; z-index: -1;}
}
#keyframes cyclethree{
0% {top: -325px; opacity: 0;}
59.94% {top: -325px; opacity: 0;}
63.27% {top:0px; opacity: 1;}
66.6% {top: 0px; opacity: 1;}
93.24% {top: 0px; opacity: 1;}
96.57% {top: 325px; opacity: 0; z-index: 0;}
97.57% {top: -325px; opacity: 0; z-index: -1;}
100% {top: -325px; opacity: 0; z-index: -1;}
}
#slider .tooltip{
background: rgba(0,0,0,0.7);
width: 60%;
height; 60px;
position: relative;
bottom: 85px;
}
#slider .tooltip h1{
color: #fff;
font-size: 24px;
font-weight: 300;
line-height: 60px;
padding: 0 0 0 10px;
}
#slider .tooltip {
transition: all 0.3 ease-in-out;
}
#media screen and (max-height: 380px){
#slider{
height: 200px;
}
#mask{
height:190px;
}
#slider img{
height:190px;
}
#slider li{
height:190px;
}
#slider ul{
height:190px;
}
#slider .tooltip{
bottom: 80px;
}
}
Change
#slider img{
max-width:100%;
display:block;
width:100%;
}
Remove absolute values of your image.
The first animation works in Firefox, but the last doesn't work. What could be the problem?
Is there something what I've missed?
http://jsfiddle.net/s6n4sc0s/
CSS:
#container {
width:300px;
height: 250px;
/*overflow:hidden;*/
}
#image{
display: block;
width: 300px;
height: 250px;
float:left;
position: relative;
}
h1{
color: #aaba38;
font-size: 26px;
font-weight: bold;
}
#title{
position: relative;
-webkit-animation: mailigen 20s infinite; /* Chrome, Safari, Opera */
animation: mailigen 20s infinite;
}
#slide{
float:left; position: relative; width:200px; text-align:right;
position: relative;
-webkit-animation: mymove 20s infinite; /* Chrome, Safari, Opera */
-moz-animation: mymove 20s infinite;
-o-animation: mymove 20s infinite;
animation: mymove 20s infinite;
}
#slide2{
position: relative;
-webkit-animation: mymove2 20s infinite; /* Chrome, Safari, Opera */
-moz-animation: mymove2 20s infinite;
-o-animation: mymove2 20s infinite;
animation: mymove2 20s infinite;
}
#slide3{
position: relative;
-webkit-animation: circle2 20s infinite; /* Chrome, Safari, Opera */
-moz-animation: circle2 20s infinite;
-o-animation: circle2 20s infinite;
animation: circle2 20s infinite;
}
#slide4{
position: relative;
-webkit-animation: circle3 20s infinite; /* Chrome, Safari, Opera */
-moz-animation: circle3 20s infinite;
-o-animation: circle3 20s infinite;
animation: circle3 20s infinite;
}
/* Chrome, Safari, Opera TITLE*/
#-webkit-keyframes mailigen {
0% {right: 0px;}
5% {right: 210px;}
10% {right: 210px;}
100% {right: 210px;}
}
/* Standard syntax */
#keyframes mailigen {
0% {right: 0px;}
5% {right: 210px;}
10% {right: 210px;}
100% {right: 210px;}
}
/* Chrome, Safari, Opera FOR SLIDE1*/
#-webkit-keyframes mymove {
0% {right: 0px;}
5% {right: 210px;}
10% {right: 210px;}
20% {right: 0px;}
100% {right: 0px;}
}
/* Standard syntax */
#keyframes mymove {
0% {right: 0px;}
5% {right: 210px;}
10% {right: 210px;}
20% {right: 0px;}
100% {right: 0px;}
}
/* Chrome, Safari, Opera FOR CIRCLE 1*/
#-webkit-keyframes mymove2 {
20% {right: 0px;}
25% {right: 260px;}
30% {right: 260px;}
40% {right: 0px;}
100% {right: 0px;}
}
#-moz-keyframes mymove2 {
20% {right: 0px;}
25% {right: 260px;}
30% {right: 260px;}
40% {right: 0px;}
100% {right: 0px;}
}
#-o-keyframes mymove2 {
20% {right: 0px;}
25% {right: 260px;}
30% {right: 260px;}
40% {right: 0px;}
100% {right: 0px;}
}
/* Standard syntax */
#keyframes mymove2 {
20% {right: 0px;}
25% {right: 260px;}
30% {right: 260px;}
40% {right: 0px;}
100% {right: 0px;}
}
/* Chrome, Safari, Opera FOR CIRCLE 2*/
#-webkit-keyframes circle2 {
40% {right: 0px;}
45% {right: 0px;}
50% {right: 260px;}
60% {right: 0px;}
100% {right: 0px;}
}
/* Standard syntax */
#keyframes circle2 {
40% {right: 0px;}
45% {right: 0px;}
50% {right: 260px;}
60% {right: 0px;}
100% {right: 0px;}
}
/* Chrome, Safari, Opera FOR CIRCLE 3*/
#-webkit-keyframes circle3 {
60% {right: 0px;}
65% {right: 0px;}
70% {right: 260px;}
80% {right: 0px;}
100% {right: 0px;}
}
/* Standard syntax */
#keyframes circle3 {
60% {right: 0px;}
65% {right: 0px;}
70% {right: 260px;}
80% {right: 0px;}
100% {right: 0px;}
}
.first, .second, .third{
float: left;
position: relative;
width: 200px;
left: 300px;
top: -260px;
text-align: right;
}
.second{padding-bottom:20px;}
/* CIRCLE ONE */
.circle {
position: absolute;
left: 320px;
top: 39px;
border-radius: 50%;
width: 180px;
height: 180px;
background-color: #bec751;
opacity: 0.8;
border: 5px solid #ffffff;
/* width and height can be anything, as long as they're equal */
}
.circle span {
color: #ffffff;
font-family: Arial;
font-size: 23px;
left: 40px;
position: relative;
font-weight: bold;
text-transform: uppercase;
top: 37px;
text-align: center ;
}
/* CIRCLE TWO */
.circle2 {
position: absolute;
left: 320px;
top: 39px;
border-radius: 50%;
width: 180px;
height: 180px;
background-color: #843881;
opacity: 0.8;
border: 5px solid #ffffff;
/* width and height can be anything, as long as they're equal */
}
.circle2 span {
color: #ffffff;
font-family: Arial;
font-size: 23px;
left: 40px;
position: relative;
font-weight: bold;
text-transform: uppercase;
top: 37px;
text-align: center ;
}
/* CIRCLE THREE */
.circle3 {
position: absolute;
left: 320px;
top: 39px;
border-radius: 50%;
width: 180px;
height: 180px;
background-color: #146671;
opacity: 0.8;
border: 5px solid #ffffff;
/* width and height can be anything, as long as they're equal */
}
.circle3 span {
color: #ffffff;
font-family: Arial;
font-size: 23px;
left: 40px;
position: relative;
font-weight: bold;
text-transform: uppercase;
top: 37px;
text-align: center ;
}
So the correct answer is, that its needed to put 0% and 100% for other browsers that chrome
#-moz-keyframes circle2 {
0% {right: 0px;}
40% {right: 0px;}
45% {right: 0px;}
50% {right: 260px;}
60% {right: 0px;}
100% {right: 0px;}
}
You don't have a #-moz-keyframes set for the circle animations. Add
#-moz-keyframes circle2 {
40% {right: 0px;}
45% {right: 0px;}
50% {right: 260px;}
60% {right: 0px;}
100% {right: 0px;}
}
To the end of your CSS for each animation. See this answer for further information
Why isn't -moz-animation working?
Alright, I am trying to make a pure CSS3 image slideshow. (Yes, I know it could be done with JQuery easier.) I cannot get it to work on my browser, chrome, so I have not yet added the syntax for the other browsers.
My HTML is...
<div class="slide-show">
<img src="pictures/slide-1.jpg" alt="Broken Earth" class="slide-1"/>
<img src="pictures/slide-2.jpg" alt="World Map" class="slide-2"/>
<img src="pictures/slide-3.jpg" alt="Sunset" class="slide-3"/>
<img src="pictures/slide-4.jpg" alt="Ursumian Flag" class="slide-4"/>
</div>
And my CSS is...
.slide-show {
border-style: solid;
border-width: 3px;
border-color: #746d27;
overflow: visible;
width: 600px;
height: 300px;
position: relative;
margin-left: auto;
margin-right: auto;
top: 30px;
}
.slide-1 {
position: relative;
-webkit-animation-name: one;
-webkit-animation-duration: 20s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
width: 600px;
height: 300px;
}
.slide-2 {
position: relative;
-webkit-animation-name: two;
-webkit-animation-duration: 20s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
width: 600px;
height: 300px;
}
.slide-3 {
position: relative;
-webkit-animation-name: three;
-webkit-animation-duration: 20s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
width: 600px;
height: 300px;
}
.slide-4 {
position: relative;
-webkit-animation-name: four;
-webkit-animation-duration: 20s;
-webkit-animation-timing-function: linear;
-webkit-animation-iteration-count: infinite;
-webkit-animation-play-state: running;
width: 600px;
height: 300px;
}
#-webkit-keyframes one {
0% {left: 0px; top: 0px;}
15% {left: 0px; top: 0px;}
20% {left: 600px; top: 0px;}
21% {left: 600px; top: 300px;}
22% {left: -600px; top: 300px;}
23% {left: -600px; top: 0px;}
95% {left: -600px; top: 0px;}
100% {left: 0px; top: 0px;}
}
#-webkit-keyframes two {
0% {left: -600px; top: -305px;}
15% {left: -600px; top: -305px;}
20% {left: 0px; top: -305px;}
35% {left: 0px; top: -305px;}
40% {left: 600px; top: -305px;}
41% {left: 600px; top: -5px;}
42% {left: -600px; top: -5px;}
43% {left: -600px; top: -305px;}
100% {left: -600px; top: -305px;}
}
#-webkit-keyframes three {
0% {left: -600px; top: -610px;}
35% {left: -600px; top: -610px;}
40% {left: 0px; top: -610px;}
55% {left: 0px; top: -610px;}
60% {left: 600px; top: -610px;}
61% {left: 600px; top: -310px;}
62% {left: -600px; top: -310px;}
63% {left: -600px; top: -610px;}
100% {left: -600px; top: -610px;}
}
#-webkit-keyframes four {
0% {left: -600px; top: -915px;}
55% {left: -600px; top: -915px;}
60% {left: 0px; top: -915px;}
75% {left: 0px; top: -915px;}
80% {left: 600px; top: -915px;}
81% {left: 600px; top: -615px;}
82% {left: -600px; top: -615px;}
83% {left: -600px; top: -915px;}
100% {left: -600px; top: -915px;}
}
Notice, the "slide-show" class does have "overflow" set to "visible." This is so I can make sure all the images are shifting properly. When they do, that will be switched to "hidden." There are 4 pictures, and each should only be moving in/out of the stage for 2 seconds total, and each should spend 3 seconds total sitting in the stage. Why do I have a lag in the last slide?
Don't only use -webkit-, add another one for every 'style' without the -webkit-
Also, can you provide a demo?