Capture ESC event when exiting full screen mode

前端 未结 3 1618
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 01:04

Requirement for me I have to show a particular div in full screen mode when I press a button and hide that div when the page comes back to normal mode.

I am able to

3条回答
  •  失恋的感觉
    2020-12-30 01:55

    $(document).keyup(function(e) {
    
      if (e.keyCode == 27) {  }   // esc
    });
    

    U may find this useful: How to detect escape key press with JavaScript?

提交回复
热议问题