Try applying pointer-events:none
for the div. Quoting MDN:
none
The element is never the target of mouse events; however, mouse events may target its descendant elements if those descendants have pointer-events set to some other value. In these circumstances, mouse events will trigger event listeners on this parent element as appropriate on their way to/from the descendant during the event capture/bubble phases.
Update
Assuming the container div is having the class .masonry
, add the following in your css
.masonry{
pointer-events:none;
}
By doing so, click events won't be triggered having the container div as target, only the child elements which are clickable will trigger click events...