loyalflow
loyalflow

Reputation: 14879

How to set the size of the dialog like auto, but add an extra 10 pixels?

I want the exact same behaviour as what jquery ui's auto, so I have:

$("#d").dialog({
    modal: true,
    autoOpen: false,
    auto: true
});

Now want I want is the same sizing behaving that the above would give me, but I want to increase the height by 10 pixels.

How can i do this?

Upvotes: 0

Views: 139

Answers (1)

Hubro
Hubro

Reputation: 59333

Either add 10px of CSS padding to the dialog content (since I'm pretty sure dialog uses innerHeight to calculate the content height) or just add 10px to the height after the dialog opens. Something like this:

var my_dialog = $("#d");

my_dialog.dialog({
    modal: true,
    autoOpen: false,
    auto: true,
    open: function() {
        my_dialog.css('height', my_dialog.height() + 10);
    }
});

Consider this pseudo-code -- I haven't tested it

I heartily recommend you try the css solution first though - Don't hack unless necessary

Upvotes: 1

Related Questions