I'm doing a very simple hover function for a button and I need to pas down a variable. I can use the variable in the first state of the hover but not in the second. Does it have something to do with the fact that the variable is defined locally and not available in within that second function?
Here's the code:
$('#'+'[id^="world_map"]').hover(function() {
var that2 = this.id;
$('#' +that2+ '_thumbnail_container').animate({"opacity" : 1}, 150, function() { });
$('#' +that2+ '_thumbnail_container').css('visibility','visible');
},
function() {
$('#' +that2+ '_thumbnail_container').animate({"opacity" : 0}, 150, function() { });
$('#' +that2+ '_thumbnail_container').css('visibility','hidden');
});
thanks!