首页 > 移动平台 > 详细

SharePoint Resize app

时间:2019-05-28 14:30:51      阅读:100      评论:0      收藏:0      [点我收藏+]
//Global Variables used in different functions.
var widthSelected=null;
var senderId;
var hostUrl = null;


//Main function to change the size dynamically.
function ResizeAppPart() {
    if (window.parent == null)
        return;

    // Extracts the host url and sender Id  values from the query string.
    var params = document.URL.split("?")[1].split("&");
    for (var i = 0; i < params.length; i = i + 1) {
        var param = params[i].split("=");
        if (hostUrl == null)
        {
            hostUrl = decodeURIComponent(param[1]);
        }

        if (i == (params.length - 1))
            senderId = decodeURIComponent(param[1]);
    }

    var height = $(".slider").height(); // Keeping the height of the app part constant.
    widthSelected = "100%";
    //use postmessage to resize the app part.
    var message = "<Message senderId=" + senderId + " >"
            + "resize(" + widthSelected + "," + height + ")</Message>";
    window.parent.postMessage(message, hostUrl);
}

 

SharePoint Resize app

原文:https://www.cnblogs.com/Javi/p/10936987.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!