Hello everyone. A while ago I tried to find a way to create a Slider Webpart. Something that would just slide through a bunch of Pictures containing some messages or news or something like that. And I found a solution.
To create your own Slider Webpart you need the following things:
When you have downloaded these Scripts we can create the Slider Webpart.
For my example I created a Picture Library called “Picture” to store my Pictures I want to use for my Slider Webpart. (I used some banner pictures I found online.)
The next step was to create a Custom List called “Slider” containing a Multiple lines of text column called “HTML”. Use the “HTML” column to add some messages to your pictures of your Slider. (For my example I just entered a few empty lines because this determines the height of the picture on your Slider Webpart. If you don´t enter something you won´t be able to see your pictures in your Slider. If you add to much text to the HTML column your picture will be repeated.)
The next step was to create a Document Library called “Script” to store all the Scripts I mentioned above.
As you saw in the above screenshot you also need a script called “SPSlider.js”. This script will actually create your Slider Webpart. Here is the code:
Please pay attention to the variables listed below. You need to adjust them for your environment.
var sliderList = "<Your-Slider-List-Name>"; // Name of the list that contains slides var slideContentField = "<Your-HTML-Column-Name>"; //Name of the Rich text field that has slide content var slideBackgroundImageField = "<Your-Picture-Library-Name>"; //Name of the picture field to use as background image
The last step is to create a Content Editor Webpart and add the Url of the “SPSlider.js” script to it.
That´s it. Your Slider Webpart is ready.
Important note: I did not create this script. I just discovered it. Have a look at the Sources for more information.
You can download the script I used for my example from here.