This script provides awesome modal transitions and I want to use them instead of a standard alert message.
Now the demo of the script shows how to trigger them by pr
I use the following code
$(document).ready(function () {
openpop();
})
function openpop(){
var overlay = document.querySelector( '.md-overlay' );
var modal = document.querySelector('#modal-11'),
close = modal.querySelector( '.md-close' );
function removeModal( hasPerspective ) {
classie.remove( modal, 'md-show' );
if( hasPerspective ) {
classie.remove( document.documentElement, 'md-perspective' );
}
}
function removeModalHandler() {
removeModal( classie.has( modal, 'md-setperspective' ) );
}
classie.add( modal, 'md-show' );
overlay.removeEventListener( 'click', removeModalHandler );
overlay.addEventListener( 'click', removeModalHandler );
if( classie.has( modal, 'md-setperspective' ) ) {
setTimeout( function() {
classie.add( document.documentElement, 'md-perspective' );
}, 25 );
}
close.addEventListener( 'click', function( ev ) {
ev.stopPropagation();
removeModalHandler();
});
}