gpt4 book ai didi

iframe - 如何在 Apex 中自动调整 iframe 的大小?

转载 作者:行者123 更新时间:2023-12-02 05:03:50 25 4
gpt4 key购买 nike

我正在尝试将另一个应用程序可视化到我的 salesforce 页面中。问题是包含其他应用程序的 iframe 的默认高度太短了。我正在寻找如何自动调整它的大小,但我没有找到任何有用的东西。我做了一个变通方法,包括放置一个很大的高度,但这是一个非常糟糕的解决方案。

这是我的顶点代码页:

<apex:page controller="CaseManagmentWizard" showHeader="false" sidebar="true" >

<apex:iframe height="3000px" src="{!callCenterAPI}api/start.php?
apiKey={!apiKey}&
username={!userIims}&
idCliente={!selectedCustomerId}&
urlOk={!callCenterURLOK}&
urlError={!callCenterURLError}
"></apex:iframe>

</apex:page>

如果我把 height="100%"和什么都没有一样!

Here's a print of how it's seen

最佳答案

计算子页面的高度并发送给父页面以设置iframe页面高度。

以下使用 jQuery 的示例代码

为 IFrame 页面提供一个 ID。

在子页面(IFrame)中写一个脚本来计算body的高度使用

$(document).ready(function () {
window.parent.setFrameStylesFromParent(j$("body").height());
})

在父页面写一个脚本来设置框架页面的高度。

function setFrameStylesFromParent(paramHeight){
j$("#iFrameId").height(paramHeight);
}

关于iframe - 如何在 Apex 中自动调整 iframe 的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13826789/

25 4 0
文章推荐: signalr.client - SignalR + 未捕获的类型错误 : Object # has no method 'sending'