jquery imageMask
This project is maintained by AlmogBaku
This jQuery plugin will allow you to add simple image-mask to your images.
Include the plugin after the jQuery:
<script type="text/javascript" src="jquery.imageMask.min.js"></script>
Using imageMask is simple!
Create image element
<img src="image.jpg" class="mySelector" />
Create mask image(black will keep stay, and the transparent will cutted of)
Add imageMask query to the ready event. use function .imageMask(path_to_mask)
$( document ).ready( function() {
$( ".mySelector" ).imageMask( "mask.png" );
} );
You can add some callback handler
$( document ).ready( function() {
$( ".mySelector" ).imageMask( "mask.png", function( $canvas ) {
console.log( 'Do something here!', $canvas );
} );
} );
DONE!