Iframe issue when i open pdf dialog box goes behin

2019-07-23 06:06发布

问题:

I am facing big issue in my site, even after googling lot of I didn't find any perfect solution.

In my web site I have included iframe in one page for viewing pdf files, But when I open dialog box it goes behind that pdf. I know the reason that pdf plugin is not rendering as part of page that's why it always display on the top.

Anyhow I need to display dialog box on the top of the pdf. I have tried following solution but nothing work, Adjusting z-index, pdfobject, embed tag, I can't adjust my dialog box according to pdf.

Except these any of the perfect solution if you have then please help regard this.

This is my sample page

Thank you.

回答1:

I've had a similar problem with a file upload form I use thats within a jquery ui dialogue. I use this snippet:

 function getMaxZ() {
        var opt = { inc: 5 };
        var def = { inc: 10, group: "*" };
        $.extend(def, opt);
        var zmax = 0;
        $(def.group).each(function () {
            var cur = parseInt($(this).css('z-index'));
            zmax = cur > zmax ? cur : zmax;
        });
        zmax += def.inc;
        return zmax;
    }
     var zIndexMax=getMaxZ();

$("#"+gridName).css({"z-index": Math.round(zIndexMax)});

Works like a charm for me, before my popup dialogues would appear behind the jquery ui one, now they don't. Hopefully it'll help you out.