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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -