I have the following mouseenter/mouseleave function:
$('.obj').on('mouseenter', function(){
var obj_top = $(this).offset().top,
obj_max = obj_top + 10;
}).on('mouseleave', function(){
var obj_top = $(this).offset().top,
obj_max = obj_top + 50;
});
Since it all happens within the same object, is there anyway I can reuse the obj_top variable throughout the functions without having to duplicate it?
objand create a variable for each one