IEQ Dialogs jQuery Dialog

I am having problems with the header width only in IE7. The first function of the dialog when opening using width: the "auto" title does not apply to the entire dialog. The second function, using minWidth, works, but acts more like a width property and does not grow in size with the content. Any ideas?

Does not work:

        $(dialogId).dialog({
            autoOpen: 'false',
            modal: true,
            draggable: false,
            resizable: false,
            buttons: buttons,
            title: title,
            width: 'auto',
            open: function(){
                /* IE HACK */
                $buttonPane = $(this).next();
                $buttonPane.find('button:first').addClass('accept').addClass('action');
                $('.ui-dialog-titlebar-close').hide();
                $('.ui-dialog').addClass('open_dialog');
                $(this).css('overflow','hidden');// IE hack
                onOpen;
            },
            close: function(){
                $('.ui-dialog').removeClass('open_dialog');
                afterClose;
            }
        });

Work (fixed width only):

        $('#conf_dialog').dialog({
            dialogClass: dialogclass,
            autoOpen: 'false',
            modal: true,
            draggable: false,
            resizable: false,
            buttons:buttons,
            title:title,
            minWidth: 255,
            open: function(){
                /* IE HACK */
                $buttonPane = $(this).next();
                $buttonPane.find('button:first').addClass('accept').addClass('action');
                $('.ui-dialog-titlebar-close').hide();
            },
            close: afterClose
        });
+3
source share
2 answers

In theory, width: auto is not supported, but it seems to work in IE8 and FF, but not on IE7

I came across this link:

http://ovaraksin.blogspot.com/2011/05/jquery-ui-dialog-with-auto-width-and.html

:

       $("#myDialog").dialog({ autoOpen: false,
            width: 'auto',
            height: 'auto',
            modal: true,
            title: 'ABC...' 
        }).bind("dialogopen", function (event, ui) {

            // fix for width:auto in IE  
            var contentWidth = $(this).width();
            $(this).parent().find('.ui-dialog-titlebar').each(function () {
                $(this).width(contentWidth);
            });

        }).bind("dialogclose", function (event, ui) {
            //fix for width:auto in IE 
            $(this).parent().css("width", "auto"); 
        });
+2

, ? : 100%?

+1

Source: https://habr.com/ru/post/1771598/


All Articles