Can you affect click event precedence?
I have the following situation
- $("li#FirstDrilldown").click(function() {
- $(this).find("div#SecondDrilldown").show();
- });
- $("div#SecondDrilldown").click(function() {
- // Do something
- });
- <ul>
- <li id="FirstDrilldown">
- <div id="SecondDrilldown" style="display:none">
- </div>
- </li>
- </ul>
I'd like to click FirstDrilldown and have it display div#SecondDrilldown. Then I'd like to be able to click SecondDrilldown to fire off a different click handler. The problem is that the click handler bound to the FirstDrilldown intercepts the click. I'm fairly sure I could bind and unbind the click FirstDrilldown click event but that's kind of an inelegant solution.
Is there just a way to just promote the SecondDrilldown click event to have a greater precedence than the one associated with FirstDrilldown?
Thanks,
BK