How to stop function after second click?

How to stop function after second click?

Hi all,

as is it in title ... How to stop function after second click? And leave that div object on coords where that function stoped = mouse was second time  clicked.  My code is there ...
my code

thank you all for answers