I want to close my window (just a div with position absolute that is draggable) when I click on the close link
This is my code
function ApplicationWindow() {
this.window = $('<div class="window"></div>');
this.create = function create() {
//.....
var closeButton = this.window.find('.close');
closeButton.live('click', this.close);
}
this.close = function close() {
this.window.fadeOut(200);
};
}
When I click on the close button the close function is executed, but the problem is that I get an error "this.window is undefined". That is because the close function is passed as a callback I think, but my question is how I can solve this on a nice way?