Last active
December 16, 2015 14:09
-
-
Save vgrem/5446672 to your computer and use it in GitHub Desktop.
Display original images in Slideshow web part (SharePoint 2010)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SlideshowObjectInitializer() { | |
ShowPic = (function(ShowPicOrig) { | |
return function() { | |
var ssObj = arguments[0]; //SlideShow object | |
var curPicIdx=ssObj.index; //current picture index | |
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'; | |
}; | |
})(ShowPic); | |
} | |
ExecuteOrDelayUntilScriptLoaded(SlideshowObjectInitializer, 'imglib.js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment