Skip to content

Instantly share code, notes, and snippets.

@indikatordesign
Last active September 9, 2017 10:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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.
(function($){
$(function(){
"use strict";
$( '#e-placeholder' ).find( 'img' ).on( 'click', function()
{
var link = $( '<a />',
{
id : 'e-remove',
href : 'mailto:my-mail@my-domain.com?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