Bronzato
Bronzato

Reputation: 9332

Specifying the height of my jQuery dialog form

I have a jQuery dialog form:

$loading.dialog({
    closeOnEscape: false,
    resizable: false,
    draggable: false,
    width: '650px',
    height: '75',
    modal: true
});

The above works. Below I adjust the height parameter from 75 to '75px'.

$loading.dialog({
    create: function () { $(".ui-dialog-titlebar").hide(); },
    closeOnEscape: false,
    resizable: false,
    draggable: false,
    width: '650px',
    height: '75px',
    modal: true
});

It doesn't work anymore. I have a tiny form. How can we explain?

Thanks.

Upvotes: 1

Views: 318

Answers (2)

alextercete
alextercete

Reputation: 5151

According to jQuery UI docs, height must be a number:

The height of the dialog, in pixels. Specifying 'auto' is also supported to make the dialog adjust based on its content.

Upvotes: 2

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262919

That's because the height option is documented to take either a number or the string "auto":

height    Number    Default: 'auto'

The height of the dialog, in pixels. Specifying 'auto' is also supported to make the dialog adjust based on its content.

As you can see, the px suffix is not supported, so your height option is ignored.

Upvotes: 1

Related Questions