I have integrated lc_switch* button to my website to allow fullscreen mode. *: https://github.com/LCweb-ita/LC-switch The button and the function works perfectly but if I press "Esc" key to exit fullscreen mode the LC_switch button don't change position to "off".
https://codepen.io/Artenis/pen/xxOopyP
I have tried that with no result:
$(document).on('keyup', function(event) {
if(event.key === "Escape") {
$('.lcs_label_on').css('left','-50px');
$('.lcs_label_off').css('right','0px');
}
edit : I have tried all solutions on the below page I got this function from here: How to detect escape key press with pure JS or jQuery?, and I tried to change Escape to == 27.