Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/06/2003, 07:27
Avatar de alexa10
alexa10
 
Fecha de Ingreso: julio-2002
Ubicación: De este lado...
Mensajes: 293
Antigüedad: 22 años, 7 meses
Puntos: 0
Saludos!!!

, imagino que si puedes, personalizando el alert con JavaScript...

Aca te pongo un código para personalizar alertas (faltan las imágenes), pero puede ser que revisando el código puedas adaptarlo a tus necesidades:

Código:
<html>
  <head>
    <title>Alertas Personalizadas</title>

    <script>
    <!--
      function customAlert(alerttype,title,msg){
        var icon;
        if(alerttype=="error")
          icon="imagenes/stop.gif";
        else if(alerttype=="info")
          icon="imagenes/info.gif";
        else
          icon="imagenes/exclaim.gif";

        newalert=window.open("","newalert","width=300,height=150,modal=yes");

        newalert.document.write('<html>');
        newalert.document.write('<head>');
        newalert.document.write('<title>' +title+ '</title>');
        newalert.document.write('</head>');
        newalert.document.write('<body bgcolor="#CCCCCC" onblur="self.focus()">');
        newalert.document.write('<table celpaddiing="10">');
        newalert.document.write('<tr>');
        newalert.document.write('<td width="50">');
        newalert.document.write('<img src=' +icon+ ' width="50" height="50" boder="0" alt="" align="left">');
        newalert.document.write('</td>');
        newalert.document.write('<td width="150">');
        newalert.document.write(msg);
        newalert.document.write('</td></tr><tr>');
        newalert.document.write('<td align="center" colspan="2">');
        newalert.document.write('<form><input type="button" value="&nbsp;&nbsp;Aceptar&nbsp;&nbsp;" onClick="window.close()">');
        newalert.document.write('</form></td></tr><table>');
        newalert.document.write('</body></html>');
        newalert.focus();
        }
    //-->
    </script>
  </head>

  <body bgcolor="#CCCCCC">
    <form>
      <input type="button" value="Cuadro de di&aacute;logo de Informaci&oacute;n" onClick="customAlert('info','Fusi&oacute;n del n&uacute;cleo','Democompany Hyperdrive Software (c) 2000')">
      <br>
      <input type="button" value="Cuadro de di&aacute;logo de Aviso" onClick="customAlert('warn','Posible Fusi&oacute;n del n&uacute;cleo','Si sigue acelerando su PSV explotar&aacute;')">
      <br>
      <input type="button" value="Cuadro de di&aacute;logo de Error" onClick="customAlert('error','Fusi&oacute;n del n&uacute;cleo','Su reactor a entrado en la fase cr&iacute;tica. ¡Lo siento!, Que tenga un feliz m&aacute;s all&aacute;')">

    </form>
  </body>
</html>
Espero que te sirva...



PD: el código fue tomado del libro Diseño de Sitios Web. Manual de Referencia, de Mc Graw-Hill.

Última edición por alexa10; 12/06/2003 a las 07:29