Background:
I'm working with HTML/CSS image slideshows. I have a method that achieves a slideshow well using just HTML and CSS (code below).
One issue is that the image slideshow is not working in Safari on iOS 7, only the first image in the series is displayed.
However, if I add the below JavaScript reference, the image slideshow starts working in iOS 7 Safari almost as great as it does on iOS 10 Safari.
<script src='https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js'></script>
But why?
Questions:
What precisely is contained in the JavaScript reference above that allows the image slideshow to work on iOS 7 Safari?
Is there a more compact JavaScript-free CSS alternative that will work on iOS 7 Safari?
If there is no CSS alternative that will work on iOS 7 Safari, what is the most compact JavaScript that will get the slideshow animating on iOS 7 Safari?
Thanks.
Code:
<!DOCTYPE html>
<html class=''>
<head>
<!--<script src='https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js'></script>-->
<style>
@keyframes slidy {
0% { left: 0%; }
20% { left: 0%; }
25% { left: -100%; }
45% { left: -100%; }
50% { left: -200%; }
70% { left: -200%; }
75% { left: -300%; }
95% { left: -300%; }
100% { left: -400%; }
}
body { margin: 0; }
div#slider { overflow: hidden; }
div#slider figure img { width: 20%; float: left; }
div#slider figure {
position: relative;
width: 500%;
margin: 0;
left: 0;
text-align: left;
font-size: 0;
animation: 20s slidy infinite;
}
</style>
</head>
<body>
<base href="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/">
<div id="slider">
<figure>
<img src="austin-fireworks.jpg" alt>
<img src="taj-mahal_copy.jpg" alt>
<img src="austin-fireworks.jpg" alt>
<img src="ankor-wat.jpg" alt>
<img src="austin-fireworks.jpg" alt>
</figure>
</div>
</body>
</html>