Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/02/2015, 11:26
elviingoomez
 
Fecha de Ingreso: febrero-2015
Ubicación: Panama
Mensajes: 4
Antigüedad: 9 años, 2 meses
Puntos: 0
Combiar llamado una funcion por getElementById a onload

tengo este codigo que genera una notificacion cuando presiono un boton, lo que deseo es cambiar que cuando carge la pagina el genere la notificacion, me parece que es con onload pero no se como hacerlo, alguien sabe como hacerlo?


Código:
(function() {
				var bttn = document.getElementById( 'notification-trigger' );

				// make sure..
				bttn.disabled = false;

				bttn.addEventListener( 'click', function() {
					// simulate loading (for demo purposes only)
					classie.add( bttn, 'active' );
					setTimeout( function() {

						classie.remove( bttn, 'active' );
						
						// create the notification
						var notification = new NotificationFx({
							message : '<p>Soy una Notificacion <a href="#">Ver más</a>.</p>',
							layout : 'growl',
							effect : 'genie',
							type : 'notice', // notice, warning or error
							onClose : function() {
								bttn.disabled = false;
							}
						});

						// show the notification
						notification.show();

					}, 1200 );
					
					// disable the button (for demo purposes only)
					this.disabled = true;
				} );
			})();

Última edición por elviingoomez; 24/02/2015 a las 11:37