I do hope my question fits here, because I read the FAQ but it isn't clear to me whether I should run code errors here. Anyway, this snippet (extracted from a project I work on) is giving me a hard time. When checking in JSFiddle it tells me that it expected } for closing the animate({ but instead found 300, but that doesn't make sense because there is nothing to match, animate is already closed.
Console then, tells me that the comma before 300 was unexpected. I really don't understand the problem with it!
var condition = offL > ((wW / 2) - $this.width()),
propertiesAnim = [],
propertiesCss = [];
if (condtion) {
properties = "'left': offL - tooltip.width() - 25";
propertiesCss = "'right', 'auto'";
} else {
properties = "'right': offR - tooltip.width() - 25";
propertiesCss = "'left', 'auto'";
}
tooltip.stop(true).css(propertiesCss).text(title).animate({
"top": ($this.offset().top + (posT / 2) - (tooltip.height() / 2)),
properties
}, 300).fadeTo(200, 1); // Error