Calling the animation functions?

Good afternoon. Arose a question.
Write the animation to a button with the following logic:
if the mouse cursor is at the top of the screen,then call the function to display the button,if the lower part,then call a function to hide this button(screenshot below).
5dfb5209b1aa6950857695.bin
However, the function is called only once ,when you reload the page and does not switch States . That is, if I reload the page and the cursor was at this point in the lower part,the button is automatically invisible if at the top,you'll see.
How do you implement the ability to toggle the status without reloading the page?
A screenshot of the plugin call:5dfb529cd52f5654793694.bin
(TK need to call it so,and not using a selector)
In a console you call a function ,that is, log fires,however, change the properties does not occur. Can't understand what the problem is.
The button's default width is 0
(A property background is added solely to check the work)
April 3rd 20 at 18:41
0 answer

Find more questions by tags JavaScriptjQueryAnimation