By clicking on the Fade button the div disappears, and then clicking on the UnFade button causes the div to reappear. So good.
If you then click the Fade button again, the div disappears, appears and disappears again.
If you then click the UnFade button, the div appears, disappears, and appears again.
If you then click fade again, the div disappears, appears, disappears, appears and disappears again.
So if you click alternately 10 times on Fade and UnFade you will see that the div goes back and forth 10 times. I wonder if you have a way to avoid this. If you click fade it disappears and Unfade appears regardless of the number of times it was clicked alternately.
function functionHide() {
$("div").hide(1000);
}
function functionShow() {
$("div").show(1000);
}
$( "#id1" ).click(function() {
$( "body" ).click(functionHide);
});
$( "#id2" ).click(function() {
$( "body" ).click (functionShow);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><buttonid="id1">Fade</button>
<button id="id2">UnFade</button>
<div>Click!</div>