Skip to content

Instantly share code, notes, and snippets.

@indikatordesign
Last active September 9, 2017 10:01
Show Gist options
  • Save indikatordesign/1a7893fc1d280913ed9cfa61b7cfefe8 to your computer and use it in GitHub Desktop.
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:[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