Reputation:
I am making a demo in which I have one row above which I have flip button .I want alert will display only when user click on row. But some time it display alert when user click on flip button? http://jsfiddle.net/9mLEj/9/
$(document).ready(function(){
$('#rowClick').click(function(){
alert('--')
})
})
Upvotes: 1
Views: 163
Reputation: 38102
You can use e.stopPropagation() to prevent event bubble up the DOM tree:
$(document).ready(function () {
$('#rowClick').click(function () {
alert('--')
})
$('#sliderClick').click(function (e) {
e.stopPropagation();
})
})
Seem like jQuery mobile has changed the structure of your HTML markup, try this:
$(document).ready(function () {
$('#rowClick').click(function () {
alert('--')
})
$('#rowClick .ui-slider').click(function (e) {
e.stopPropagation();
})
})
Upvotes: 1