The Slide Show Web part displays the images from the given picture library with its actual size i.e the size of the Slide Show Web part varies according to the size of the image. We can restrict the size of the web part through Edit Web Part properties but this does not change the size of the image. To display the whole image within that restricted area we have to change the height & width of the image during runtime to fit to the size. Only change the image size will not display the image in the middle position. To do this we first have to change the size of the table td tag to fit to the Slide Show Web Part screen.
Below script first
sets the size of the table td tag & then sets the size of the image.
<script
type="text/javascript">
$(document).ready(function()
{ var tdlist=$("div[id^='WebPartct100']");
tdlist.width('100%');
//assign the height & width to the td
currtd.height('150px');
currtd.width('240px');
//get the ID of the DIV of slide show web part
var divList = $("div[id^='MSOPictureLibrarySlideshowWebPart']");
var currImage= $("img[id$='curr']");
divList.height('100%');
divList.width('100%');
//assign the height & width to the image
currImage.width('230px');
});
This is not working. would you please specify which div ID to copy into the code. I do not see any on opening the page in designer.
ReplyDelete:) Good
ReplyDelete