I have a quick question on how to call variables inside an if/else statement of a function. My thought looks like this.
var variable = {
anything
}
var variable2 = {
anything
}
var options = function () {
if($(this).hasClass(".itemname")){
return variable
} else {
return variable2
}
};
$("#items li").click(options);
If I understand well, you ask for something like this:
http://jsfiddle.net/pd3FV/