How to detect keyboard show/ hide event in jquery for mobile web application

后端 未结 5 1941
故里飘歌
故里飘歌 2020-12-30 01:00

I am working on web base mobile (HTML) application. Is there any way to detect keyboard event like when keyboard is visible and keyboard hide, base on that I can control o

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 01:20

    if($(document.activeElement).attr('type') == "text"){
        console.log("Keyboard is visible");
    }else{
        console.log("Keyboard is not visible");  
    }
    

提交回复
热议问题