将SharePoint幻灯片显示链接设置为任何URL

时间:2018-12-12 17:16:25

标签: url sharepoint slideshow

我试图将SharePoint 2013幻灯片显示链接设置为指向输入到“超链接”列中的URL输入,该列已添加到SharePoint图片库表单中。

到目前为止,我已经设法删除了默认链接(指向图片),但无法弄清楚该怎么做

  1. 在“超链接”字段中获取链接输入
  2. 设置该链接到图片

在ssObj.link.href行下面的代码中,仅将“ $ titleField”附加到我的网站网址(即https://mysite/ $ titleField)

function SlideshowObjectInitializer() {

  ShowPic = (function(ShowPicOrig) {
      return function() {

       var ssObj = arguments[0];  //SlideShow object
       var curPicIdx=ssObj.index; //current picture index
        var $titleField = $("input[title='Hyperlink']").val();          
       ShowPicOrig.apply(this, arguments); //call original ShowPic

       //apply some changes to display original picture in SlideShow control
       ssObj.image.src = ssObj.linkArray[curPicIdx]; //display original image instead of web image
       //change picture & container size to auto instead of fixed (by default web image size is used)
         ssObj.image.setAttribute('height','100%'); 
         ssObj.image.setAttribute('width','100%'); 
         var cell = ssObj.cell; 
         cell.style.width = 'auto';
         cell.style.height = 'auto';
         cell.style.display = '';
         var pcell = ssObj.cell.parentNode; 
       pcell.style.width = 'auto';
         pcell.style.height = 'auto';
         ssObj.link.removeAttribute("href");
         ssObj.link.href = '$titleField';
  };
  })(ShowPic);

}  

ExecuteOrDelayUntilScriptLoaded(SlideshowObjectInitializer, 'imglib.js');

0 个答案:

没有答案