Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <style>
  2. .slideshow{
  3. position:absolute;
  4. margin:auto;
  5. top:18%;
  6. left:0;
  7. right:0;
  8. width:66%;
  9. height:73%;
  10. border:none;
  11. overflow:hidden;
  12. vertical-align:middle;
  13. z-index:100;
  14. animation-name:slide;
  15. animation-duration:11s;
  16. animation-delay:0s;
  17. animation-iteration-count:infinite;}
  18. </style>
  19.  
  20.  
  21.  
  22. <div class="slideshow">
  23. <?php
  24. $folder = "uploads";
  25. $images = scandir('uploads');
  26. $amount = count($images);
  27.  
  28. for ($i=2; $i<>$amount;$i++)
  29. {
  30. $imgid=$i - 1;
  31. { echo '<a id="track" target="_blank" href="'.$url.'"><img src="'.$folder . '/' .$images[$i].'" id="'.$imgid.'" class="file2"></a>';
  32. }
  33. }
  34. ?>
  35. </div>
  36.  
  37.  
  38. <script>
  39. var firstPicturein = document.getElementById("1");
  40. var picturein = firstPicturein;
  41. var i = 0;
  42. function rotateImagesin() {
  43. //hide 6 images
  44. for (j = 0; j < 3; j++) {
  45. // hide current element
  46. picturein.style.display = "none";
  47. // next element
  48. if (i >= document.getElementById("slideshowin").childNodes.length) {
  49. i = 0;
  50. picturein = firstPicturein;
  51. } else {
  52. picturein = picturein.nextSibling;
  53. };
  54. // show the next element
  55. picturein.style.display = "inline";
  56. i++;
  57. };
  58. };
  59.  
  60. window.onload = function(){
  61. var curImg = document.getElementById("1").style.display = "inline";
  62. setInterval(rotateImagesin, 11000);
  63. };
  64. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement