I'm using the elastic grid plugin for a grid display system on a site, but I want to be able to simply click off the expanded view and it automatically close without having to click on the thumbnail or 'x' button as the plugin suggests.
I've had a bit of a look through the code and think this is where I need to edit
function initEvents() {
//when clicking an item, show the preview with the items info and larg image;
//close the item if already expanded.
//also close if clicking on the item's cross
$items.on( 'click', function(e) {
hidePreview();
return false;
} ).children( 'a' ).on( 'click', function(e) {
var $item = $( this ).parent();
//check if item already opened
current === $item.index() ? hidePreview() : showPreview( $item );
return false;
});
However, I'm not sure exactly how to do this. I was trying to implement this method mentioned here but am having no luck. Any guidance in this would be appreciated.
The plugin for reference: http://demo.phapsu.com/jquery.elastic_grid/