How to modify the width and height of a Sharepoint Page Viewer web part dynamically

You can use following JavaScript code to dynamically adjust width and height of the page viewer web part. Just put it in each asp.net page that you want to display in a page viewer, and the problem will be solved:

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


Alternatively, window.resizeTo(window.screen.availWidth, window.screen.availHeight); can also be used.

Comments

Popular posts from this blog

Adding Contact Selector Control to InfoPath form

Adding Validation to a Custom NewForm.aspx in SharePoint & Redirect

How to add to Sub-Sub Menu in SharePoint