Curious if anybody knows how to make a Popover window close by pressing the escape button for Website / App feedback.
Thanks!
Page 1 / 1
Hello @Nash9392
Try this if it help..
$('#example').popover();
$(document).keyup(function (event) {
if (event.which === 27) {
$('#example').popover('hide');
}
});
Try this if it help..
$('#example').popover();
$(document).keyup(function (event) {
if (event.which === 27) {
$('#example').popover('hide');
}
});
Hello @Nash9392 ,
Add this java script code to the question implementing popover
Event.observe(document,'keydown',function(e){
if (e.keyCode == 27) // if esc was pressed
{
//add display:none css to popover
}
Note: please give your popover code, so that I can give commented part of the above code i.e changing css using js
Add this java script code to the question implementing popover
Event.observe(document,'keydown',function(e){
if (e.keyCode == 27) // if esc was pressed
{
//add display:none css to popover
}
Note: please give your popover code, so that I can give commented part of the above code i.e changing css using js
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.