IFrame inside the Jquery accordion

I have a page that has an iFrame embedded inside a JQuery accordion.


$(function() {





For some reason I can not see the embedded iFrame but I can see the accordion. Also if i remove the line $("#doc_accordion").accordion()
then I can see the iFrame correctly embedded in the page. Has anyone else experienced a similar problem?

This I believe is because IE does not render children of hidden elements. As a workaround, you can load a 1px by 1px iframe outside the accordion and move it into the accordion once the iframe has loaded. Here is an example:

    $(function () {
            collapsible: true,
            autoHeight: false,
            active: false
        $('#widget-frame').load(function () {
            if ($("#widget-placeholder > iframe").size() == 0) {
            this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
            this.style.width = '100%';


Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » IFrame inside the Jquery accordion

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录