我正在开发一个SharePoint托管应用程序&需要根据内容和计算来计算动态高度。屏幕分辨率,保持宽度为100%。我在下面的代码和&我有2个场景。
我无法确定问题,因为我也没有在开发者信息中心看到任何错误。任何人都可以帮我这个吗?
< script type = "text/javascript" >
window.Communica = window.Communica || {};
$(document).ready(function() {
Communica.Part.init();
});
Communica.Part = {
senderId: '',
init: function() {
var params = document.URL.split("?")[1].split("&");
for (var i = 0; i < params.length; i = i + 1) {
var param = params[i].split("=");
if (param[0].toLowerCase() == "senderid")
this.senderId = decodeURIComponent(param[1]);
}
this.adjustSize();
},
adjustSize: function() {
var resizeMessage = '<message senderId={Sender_ID}>resize({Width}, {Height})</message>';
resizeMessage = resizeMessage.replace("{Sender_ID}", this.senderId);
//Dynamic height to be calculated, at the moment fixed height is also not working
resizeMessage = resizeMessage.replace("{Height}", "500px");
resizeMessage = resizeMessage.replace("{Width}", "100%");
window.parent.postMessage(resizeMessage, "*");
}
}; < /script>
&#13;
<div id="userDataContent">
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
</div>
&#13;