I believe my question is the reverse of this one: Prevent execution of parent event handler
I'm building a UI in Google Apps Script. I have a select box, inside a larger container div. I want to be able to run an animation using jQuery when the parent div is clicked, but I don't want the animation to run when the select box is clicked. I tried using stopPropagation, but that's not helping. Currently the animation runs when either the div itself, or the select drop-down is clicked:
var ISDOWN = true; //global to track whether div is down or up
$("#outer-container").click(
function(e) {
e.stopPropagation();
var source = $(this).attr('id');
if (source === "outer-container"){
if (ISDOWN === true){
$("#outer-container").animate({top: "8px"});
ISDOWN = false;
}
else {
$("#outer-container").animate({top: "45px"});
ISDOWN = true;
}
}
});