The point of this is to have a div fixed to the bottom of the window. When the user clicks on that div. The ViewPort will fill with the div. Inside this div is a Cancel button. It is html and CancelForm() will execute on click. Obviously once the div is clicked, I have to unbind the function, or

FillScreen

will execute with every form input click etc.

I have tried making the

CancelForm() bind

function the same as the

load

callback type. I have tried everything. I have made

FillScreen

= to an anonymous function. I've tried almost every combination of return types I can think of. Where am I going wrong?

Edit:

CancelForm has received a makeover, and the issue persists. CancelForm as following executes FillScreen immediately.

Another thing that was wrong with your code, as mentioned by @SLaks is the use of unbind - in which you tried to unbind an anonymous function instead of unbinding it just the way you bound it - so you'd just increment the amount of listeners on your div that would all trigger together.

Anyhow, using unbind here is unnecessary as we want the listeners on both elements, we'll just cancel the event when needed.