Sorry if this sounds weird but i have tried to create a function that checks a variable before executing the remaining jQuery code, it looks something like this:
$(document).ready(function(){
var myVar = true;
var myFunction = function(){
if (myVar) {
// do something
};
};
$("div").click(function(){
myFunction();
$("div).fadeOut("fast");
});
});
I guess this is not how you implement a function in jQuery so i am a bit lost.
$("div).fadeOut("fast");Syntax error, after div need""after div. I don't know if that is a typo or your problem. If that isn't the issue, what errors are you getting? We need more detail than that