Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
jQuery UI dialog width & height based on screen width & height

Currently (jQuery 1.4.4 and UI 1.8.8) I used the following to set a dialog's properties: (I'm trying to set the dialog to be 180px less than the height and width of the screen.)

$("#dialog").dialog({ 
            bgiframe: true,
            position: 'center',
            width: $(window).width()-180,
            height: $(window).height()-180,
            title: ititle,
            modal: true,
            buttons: { "Close": function() { $(this).dialog("destroy"); }}
});

The above works fine in FF but in IE 8 it fails.

Is this the right way to set width and height or should I be doing something differently?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

This worked for me in IE8:

var winW = $(window).width() - 180;
var winH = $(window).height() - 180;

$( "#dialog" ).dialog({
    autoOpen: false,
    height: winH,
    width: winW,
    modal: true
});

You'll need this at the top of your page though

<!DOCTYPE html>
over 4 years ago · Santiago Trujillo Relatório

0

You probably need to specify the DOCTYPE and use standards mode for it to work correctly.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda