Last active
September 9, 2017 10:01
-
-
Save indikatordesign/1a7893fc1d280913ed9cfa61b7cfefe8 to your computer and use it in GitHub Desktop.
[Mask email]Trigger to open email-client by clicking on an image using jQuery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$(function(){ | |
"use strict"; | |
$( '#e-placeholder' ).find( 'img' ).on( 'click', function() | |
{ | |
var link = $( '<a />', | |
{ | |
id : 'e-remove', | |
href : 'mailto:[email protected]?Subject=I want to get in touch with you!&body=My message to you.', | |
text : '.', | |
style : 'display:none;', | |
on : { click : function() | |
{ | |
this.remove(); | |
}} | |
}).appendTo( $(this).parent() ); | |
document.getElementById( 'e-remove' ).click(); | |
}); | |
}); | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment