Skip to content

Instantly share code, notes, and snippets.

@mircian
Created April 28, 2017 18:36
Show Gist options
  • Save mircian/1af3f5acfb7eb0636ad1efdb31e17c05 to your computer and use it in GitHub Desktop.
Save mircian/1af3f5acfb7eb0636ad1efdb31e17c05 to your computer and use it in GitHub Desktop.
<a href="#" class="wsl_print" data-target=".search-results">
Print element
</a>
jQuery('body').on('click', '.m_print', function (e) {
e.preventDefault();
var target = jQuery(this).data('target');
jQuery(this).closest(target).printThis({
importStyle: true
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment