jQuery click function exception -
i displaying container <div class="expand">
- when clicked on - expands section
below it:
html:
<div class="expand"> <div class="container1"> <div class="container2"> <a class="view">view</a> <a class="download">download</a> </div> </div> </div> <section class="hidden"> ... </section>
jquery:
$('.expand').click(function () { var $this = $(this); $this.next().show(); });
as can see, there "download" button child element of <div class="expand">
. download button should element in container not trigger said section shown.
so this:
$('.expand').not(".download").click(function () { ... });
or
$('.expand').except(".download").click(function () { ... });
you'll need include function @ end of code:
it's here: event.stoppropagation()
please try, work!
Comments
Post a Comment