-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslideshow.php
47 lines (41 loc) · 1.06 KB
/
slideshow.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html lang="en">
<head>
<title>Simplest jQuery Slideshow</title>
<style>
body {font-family:Arial, Helvetica, sans-serif; font-size:12px;}
.fadein {
position:relative; height:332px; width:500px; margin:0 auto;
background: #ebebeb;
padding: 10px;
}
.fadein img{
position:absolute;
width: calc(96%);
height: calc(94%);
object-fit: scale-down;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(function(){
$('.fadein img:gt(0)').hide();
setInterval(function(){$('.fadein :first-child').fadeOut().next('img').fadeIn().end().appendTo('.fadein');}, 5000);
});
</script>
</head>
<body>
<div class="fadein">
<?php
// display images from directory
// directory path
$dir = "./art-studies-dir/";
$scan_dir = scandir($dir);
foreach($scan_dir as $img):
if(in_array($img,array('.','..')))
continue;
?>
<img src="<?php echo $dir.$img ?>" alt="<?php echo $img ?>">
<?php endforeach; ?>
</div>
</body>
</html>