How to close a pop up window by clicking the close button?

hanswurstel

New Member
This is my div in the aspx page:\[code\]<div id="pop-up"> <button id="btnClose">Close</button> <div id="mopopuptitle"> </div> <table id="popuptable" cellspacing="15"> </table> </div>\[/code\]This is my js code:\[code\]$('td#' + parentElement).find('span.download_active').next().hover(function (e) { topPos = e.pageY - ($('div#pop-up').height()) - 35; leftPos = e.pageX - ($('div#pop-up').width()) - 30; if (leftPos < 0) { leftPos = 10; } GetAssociatedPeopleList(json_row.value.task_id); $('div#pop-up').show().css('top', topPos).css('left', leftPos).appendTo('body'); $('#mopopuptitle').html('People who have taken up this Request'); $('#btnClose').button({ icons: { primary: "ui-icon-closethick" }, text: false }) .css({ width: '30px', height: '20px', position: 'absolute', right: -'25px', top: '-25px' }) .click($(this).close()); }, function() { });\[/code\]The above code has some business logic. Dont bother about that.. All i need is when i click the close button the pop up has to be closed..I have tried these lines..\[code\]$('div#pop-up').show().css('top', topPos).css('left', leftPos).appendTo('body'); $('#mopopuptitle').html('People who have taken up this Request'); $('#btnClose').button({ icons: { primary: "ui-icon-closethick" }, text: false }) .css({ width: '30px', height: '20px', position: 'absolute', right: -'25px', top: '-25px' }) .click($(this).close());\[/code\]I couldn achieve by trying this code.. What should i change?? Is there any alternative for this?? Please help me out..
 
Back
Top