简体   繁体   中英

blur() event is not working on IPAD and Iphone

I have tried blur() for replacing the css but that function is not working. I did research on it that blur() is not work for IOS device. Is there any other way to remove position from .body-clip-overflow when focus is out from input field. My code is attached below. Link

$(document).on('focus', 'input, textarea', function() {
   $('.body-clip-overflow').css('position', 'fixed');
   $('.ui-dialog').css('position', 'absolute');
   $('.ui-dialog').css('top', '80px');
 });

$(document).on('blur', 'input, textarea', function() {
   setTimeout(function() {
      $('.body-clip-overflow').css('position', 'relative');
   }, 100);
});

Try this:

$(document).live('blur', function () {
   //some code
});

or try 'keyup':

$(document).live('keyup', function () {
    //some code
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM