I have a set of divs that looks like this
<div class="videoThumbnail" data-videoid="4">
<div class="video"><img src="some/Url" alt="video thumbnail preview"/></div>
<div class="title">I'm a video</div>
<div class="download"><span class="ui-icon ui-icon-arrowthickstop-1-s"></span></div>
</div>
Then I am binding an event to the videoThumbnail
class. That function works fine and well but I now need to bind another event for when download
is clicked. My two bind events look like this.
//Bind selecting a thumbnail to change the video
$( '.videoThumbnail' ).not( '.download' ).on( 'click', function ( t ) {
alert('you are doing thumbnail stuff');
} );
//Bind download on the litle download icon
$( '.download' ).on( 'click', function ( t ) {
alert('you want to download this');
} );
I would like the first bind event on videoThumbnail
to only happen when it's not selecting the download
within it. Unfortunately whenever i press the download
icon both functions execute. How can I bind the first event to the videoThumbnail
without binding it to the download
that's inside of it?