jQuery v1.3.2 rev 6246 (and I just tried with the current nightly
build too - same behaviour)

Given the following html which basically has a button floated over the
top right corner of an image:

<div class="abc">
    <div class="xyz">
        <img src="..." title="..." />
        <button type="button">X</button>
    </div>
</div>

When I set up a couple of live handlers:

$('.abc .xyz img').live('click', function() {
    // handler A....
})

$('.abc .xyz button').live('click', function() {
    // handler B....
})

If I click on the image taking care to not position the cursor over
the bounds of the button, I find both handlers are executed. Am I
doing something wrong? I have even gone to the trouble of adding a
unique class to the img and button elements and changing the handlers
to:

$('.my_unique_img_class').live('click', function() {
    // handler A....
})

$('. my_unique_button_class').live('click', function() {
    // handler B....
})

but the behaviour is the same. Interestingly, Firefox works correctly.
Chrome + Safari 4 exhibit the problem.

Cheers!
Lee

Reply via email to