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

432
Vistas
¿Cómo centrar la ventana emergente? Imagen que abre una ventana emergente

Estoy usando el siguiente código:

 <center>Supporto Live Chat<br> <a onclick="window.open('https://google.com/','Live Chat','scrollbars=yes,width=500,height=715');return false;" href="https://google.com"><img class="wp-image-1182 aligncenter" alt="live-butt" src="https://cdn.pixabay.com/photo/2016/06/06/16/39/phone-1439839_960_720.png" width="142" height="75" /></a> </center> <hr>

Esto se puede probar aquí: https://htmledit.squarefree.com/

Pero tengo el problema de que la ventana emergente abierta no está centrada. ¿Alguna sugerencia sobre cómo se puede editar el código para que la ventana emergente esté centrada?

Gracias

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

0

Vaya a esto como referencia: https://www.geeksforgeeks.org/how-to-center-a-popup-window-on-screen/#:~:text=This%20example%20creates%20the%20pop%20up% 20ventana%20y%20ubicación%20%20en%20centro

 <center>Supporto Live Chat<br> <a onclick="window.open('https://google.com/','Live Chat','scrollbars=yes,width=500,height=715');return false;" href="https://google.com"><img class="wp-image-1182 aligncenter" alt="live-butt" src="https://cdn.pixabay.com/photo/2016/06/06/16/39/phone-1439839_960_720.png" width="142" height="75" /></a> </center> <hr> <script> function createPopupWin(pageURL, pageTitle, popupWinWidth, popupWinHeight) { var left = (screen.width - popupWinWidth) / 2; var top = (screen.height - popupWinHeight) / 4; var myWindow = window.open(pageURL, pageTitle, 'resizable=yes, width=' + popupWinWidth + ', height=' + popupWinHeight + ', top=' + top + ', left=' + left); } </script>

about 4 years ago · Juan Pablo Isaza Denunciar

0

¿Qué tal un javascript para ayudarte? El javacsript calcula el centro de la pantalla y coloca la ventana allí.

 <!DOCTYPE html> <html> <body> <script> function myPopup(myURL, title, myWidth, myHeight) { var left = (screen.width - myWidth) / 2; var top = (screen.height - myHeight) / 4; var myWindow = window.open(myURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + myWidth + ', height=' + myHeight + ', top=' + top + ', left=' + left); } </script> <center>Supporto Live Chat<br> <a onclick=" myPopup ('https://google.com/','Live Chat', 500, 715);"><img class="wp-image-1182 aligncenter" alt="live-butt" src="https://cdn.pixabay.com/photo/2016/06/06/16/39/phone-1439839_960_720.png" width="142" height="75" /></a> </center> </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