Give help. Get help.

  • # September 11, 2017 at 1:03 am


    I am using this slider on sharepoint 2013 and created library with columns for banner images text and wanted to add a hyper link on banners.

    I have tried and place a condition if banner link is in the column add the hyper link otherwise just show banner without hyperlink
    I have created a hyper link column and try to use it in the code but it some how not showing all banners.
    it only shows first 7 banners.

    here is my code.


        jQuery(document).ready(function($) {
           var sliderList = "Slider"; // Name of the list that contains slides
           var slideContentField = "HTML"; //Name of the Rich text field that has slide content
           var slideBackgroundImageField = "Picture"; //Name of the picture field to use as background image
           var slideHyperlink = "BannerLink"; //Name of the hyperlink field to use as banner link

    function HillbillySlider(sliderList,slideContentField,slideBackgroundImageField,slideHyperlink) {

          //query to retrieve all items
          var query = "";
          //return fields for slide content and background picture
          var camlViewFields = "";
               operation: "GetListItems",
               async: true,
               listName: sliderList,
               CAMLViewFields: camlViewFields,
               CAMLQuery: query,
               completefunc: function(xData, Status) {
                    $(xData.responseXML).SPFilterNode("z:row").each(function() {
                    var slideContent = ($(this).attr("ows_"+slideContentField));
                    var picture = $(this).attr("ows_"+slideBackgroundImageField)==null?"":$(this).attr("ows_"+slideBackgroundImageField).split(",")[0];
                    var BannerLink = $(this).attr("ows_"+slideHyperlink)==null?"22":$(this).attr("ows_"+slideHyperlink).split(",")[0];
                    if (BannerLink === "22")
                        //create slide (li) and append it to other slides
    </li>"); } else { //create slide (li) and append it to other slides $("#hillbillySlider").append("<a href='"+BannerLink+"' target='_self'><li>
    </li></a>"); // $("#hillbillySlider").append("<li>


               }); // end completefunc
               //start the slider
          }); // end SPServices call

      Any help would be greatly appreciated

    Viewing 16 post (of 16 total)

    You must be logged in to reply to this topic.