$("#b").bind("click", function (e) {
var $target = $(e.target);
if (!($target.is('a'))) {
//if height is normal
if (open[2] == 'n') {
openbox(this);
}
//height is bigger
else {
closeBox(this);
}
}
});
This works.
I want to also check if an area inside a fieldset is clicked. If so, I don't want the box to close because I want the user to be able to fill in a form, but my code doesn't work:
$("#b").bind("click", function (e) {
var $target = $(e.target);
if (!($target.is('a')) && !($target.is('fieldset')) ) {
//if height is normal
if (open[2] == 'n') {
openbox(this);
}
//height is bigger
else {
closeBox(this);
}
}
});
i also tried:
if(!($target.is('a','fieldset')))
but that didn't work. I also tried another if statement under the check for !a
Help please...

New Topic/Question
Reply


MultiQuote




|