Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created May 22, 2014 19:43
Show Gist options
  • Save whyisjake/745a75b4af474e741d72 to your computer and use it in GitHub Desktop.
Save whyisjake/745a75b4af474e741d72 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
function isValidEmail( $email ) {
return eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email);
};
$('.CLASS-OF-SUBMIT-BUTTON').click( function() {
var email = $('#tyvyh-tyvyh').val();
if ( isValidEmail( email ) ) {
$(".fancybox2").fancybox({
width: 640,
height: 320,
afterLoad: function() {
setTimeout( function() {
$.fancybox.close();
},
2000); // 2 secs
}
});
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment