I have JQuery UI Dialog opening on pressing CTRL + Q using the following code..
$(window).keydown(function (e){
if (e.ctrlKey && e.keyCode == 81){
$('<div><center>Download the files now?</center></div>').dialog({
title: '<b>Download</b>',
modal: true,
autoOpen: true,
height: 400,
width: 800,
resizable: false,
buttons: {
"Yes": function(){
// Code to download the Files
$(this).dialog('close');
},
"Close": function(){
$(this).dialog('close');
}
}
});
return false;
}
});
But how can i close the dialog on pressing them again? I want to implement the toggle effect for the dialog with CTRL + Q.
How about something like that?
DEMO: http://jsfiddle.net/95w4m/