I don't know about the fading part as I don't have access to wow atm but this is what I use for the showing/hiding of a frame when a target exists:
Code:
function eePanels2:PLAYER_TARGET_CHANGED()
if UnitExists("target")then
THIS:Show()
else
THIS:Hide()
end
end
eePanels2:RegisterEvent("PLAYER_TARGET_CHANGED")