After the SharePoint 2010 Slideshow I searched for a better solution for SharePoint 2013. I found a lot of Slideshow solutions still using SOAP calls.
The better solution in this case (see announcement below) was creating a solution based on the new SharePoint 2013 REST API.
With 3 simple steps and minimal code we can create a cool slider.
This is the slider we want to go for, as seen on http://www.slidesjs.com
Take a look at the following demo:
OK, let’s start!
Add an app > Picture Library > Name it “Banners” > Add some images
The result should be the following:
First add the placeholder for the append images code
Now we can add the REST call to the “Banners” Picture Library and run the slidesjs plugin
Copy and paste : )
jQuery(document).ready(function() { var basePath = "/_api/"; jQuery.ajax({ url: basePath + "lists/GetByTitle('Banners')/items?$select=EncodedAbsUrl,Title", type: "GET", headers: { "Accept": "application/json;odata=verbose" }, success: function (data) { //script to build UI HERE jQuery.each(data.d.results, function (index, value) { jQuery("#slides").append("<img src='" + value.EncodedAbsUrl + "'" + " alt='" + value.Title + "'/>"); }); jQuery(function () { jQuery('#slides').slidesjs({ play: { active: true, auto: true, interval: 5000, swap: true } }); }); }, error: function (data) { //output error HERE alert(data.statusText); } }); });
Now,
Good luck!