Slideshow scroller from folder - html/js

Hi,
Can someone help me with slideshow that fetch a folder instead of <img src="">?

The page is on sharepoint server so, I built it with webpart of javascript that uses js/css files

Thanks for all

html

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://Tests/Shared%20Documents/fadein.css" />

<script type="text/javascript" src="http://Test/Shared%20Documents/fadein.js"></script>

<div class="fadein">
<img src="https://farm3.static.flickr.com/2610/4148988872_990b6da667.jpg">
<img src="https://farm3.static.flickr.com/2597/4121218611_040cd7b3f2.jpg">
<img src="https://farm3.static.flickr.com/2531/4121218751_ac8bf49d5d.jpg">
</div>


fadein.js

$(function(){
$('.fadein img:gt(0)').hide();
setInterval(function(){
$('.fadein :first-child').fadeOut()
.next('img').fadeIn()
.end().appendTo('.fadein');}, 
3000);
});

Hi @gaicohen85, no you can’t request the contents of a folder with JS, only specific resources. What you might do though is write a backend endpoint that gives you the folder contents as JSON, and then loop over these with JS and fetch each image separately.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.