SharePoint 2013 Slider / Rotator web part
SharePoint 2013 : Creating Image Slider / Rotator web part with Content Editor In SharePoint Page
<img id="PicturePlaceholder" src="/sites/test/Pictures/Lighting-01.jpg" alt=""/><script type="text/javascript"><span id="ms-rterangecursor-end"></span>
var PictureLibraryURL = "/sites/test/_vti_bin/owssvr.dll?Cmd=Display&XMLDATA=TRUE&List=%7BB1313FAF-F09C-4BDD-9134-95CA6A85D34F%7D";function DisplayPicture(xmlhttpobject){var xmlDoc = xmlhttpobject.responseXML;var ListItems = xmlDoc.getElementsByTagName("z:row")||xmlDoc.getElementsByTagNameNS("*","row");var SelectedItem = Math.floor(Math.random()* ListItems.length);PictureURL = "/" + ListItems[SelectedItem].getAttribute("ows_RequiredField");document.getElementById("PicturePlaceholder").src= PictureURL;}try {var xmlhttp = new XMLHttpRequest();} catch(e) {try {var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");} catch(e) {try {var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");} catch(e) {alert("Your browser does not support XMLHTTP.");}}}xmlhttp.onreadystatechange=function(){if (xmlhttp.readyState==4){if (xmlhttp.status==200){setInterval ( "DisplayPicture(xmlhttp)",10000);}else{alert("Problem retrieving XML data");}}};xmlhttp.open("GET",PictureLibraryURL,true);xmlhttp.send(null);</script>
Replace following with your won content :
- " /sites/test/Pictures/Lighting-01.jpg"
- with your own picture library
- /sites/test/_vti_bin/owssvr.dll
- "/sites/test/" with your site
- List=%7BB1313FAF-F09C-4BDD-9134-95CA6A85D34F%7D
- with your ListId