Wednesday, May 13, 2009

Modifying the width & height of a Sharepoint Page Viewer web part dynamically

Issue:
By default Page viewer web part doesn't allow you to have height expand dynamically. It expects a unit for the height. This small javascript I got from GuiCreate.com does a great job. Basically this script needs to be copied into the page which needs to be displayed in the web part.

JavaScript code:

function resizeMe(that) {
window.resizeTo(document.body.scrollWidth, document.body.scrollHeight);
}
window.attachEvent("onload", function() {
window.setTimeout("resizeMe()", 100);
});


Link: http://www.guicreative.com/blog/sharepoint-2007/modifying-the-width-height-of-a-sharepoint-page-viewer-web-part-dynamically/

No comments: