Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

234
Vistas
Change the width of jQuery UI dialog in Qualtrics

im programming a survery in Qualtrics. I want to code a clickable button, that shows some text in a box.

The codes I used are:

In the Qualtrics survey-header:

<link href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<script src="//code.jquery.com/jquery-1.12.4.js">    </script>
<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js">    </script>
<script>
        jQuery("[id*='dialog']" ).dialog({ autoOpen: false});  
        jQuery('body').on('click','.ui-widget-overlay',function(){ jQuery("[id*='dialog']").dialog('close'); });
                            </script>

JS in the specific question:

Qualtrics.SurveyEngine.addOnload(function()
{
jQuery("#btn1").click(function() {
jQuery("#dialog").dialog( "option", "modal", true);
jQuery("#dialog").dialog( "open", "width", 500).css({

"padding":"0px"
});
   })
});

HTML in the question text:

<button id="btn1"> BUTTON TEXT </button><br>
<span title="MOD Explanation" id="dialog"> TEXT IN BOX</span>

However, I cannot change the width of the box. I would like it to spread about 60% over screen with a min-width of 450px.

Thanks for any help!

Best, Tim

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Comment explains how to do it, not sure what Qualtrics.SurveyEngine.addOnload is, api here: https://api.jqueryui.com/dialog/

$(document).ready(function() {
  jQuery("#btn1").click(function() {
    jQuery("#dialog").dialog({modal: true, width: "60%", minWidth: 450}); // you need to pass object here docs: https://api.jqueryui.com/dialog/
  })
})
<html>

<head>

  <script src="//code.jquery.com/jquery-1.12.4.js"></script>
  <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
</head>

<body>
  <button id="btn1"> BUTTON TEXT </button><br>
  <span title="MOD Explanation" id="dialog"> TEXT IN BOX</span>
</body>

</html>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda