I have the following code:
$('#picture-div').click(function(){
$('#div-in-document').fadeToggle('slow', $func1);
});
$('#picture-div2').click(function(){
$('#div-in-document2').fadeToggle('slow', $func2);
});
I'm trying to make this into one single click event, but can't seem to make it work. I've tried the following:
$('#picture-div ,#picture-div2').click(function(){
if($(this) == '#picture-div')
$('#div-in-document').fadeToggle('slow', $func);
else
$('#div-in-document2').fadeToggle('slow', $func2);
});
But that always go to the else, so my if-statement is invalid.
Thanks.