How to close the keypad in safari browser when the user clicks on input field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • user7777
    New Member
    • Sep 2014
    • 6

    How to close the keypad in safari browser when the user clicks on input field

    I'm working on responsive design. I was struck with the issue, where the input field which has read only attribute, I want to disable the keypad in safari browser. The code I used was,
    Code:
    var currentscroll = 0;
    $('input, textarea').bind('focus',function() {
       currentscroll = $(window).scrollTop();
    });
    $('input, textarea').bind('blur',function({
       if(currentscroll != $(window).scrollTop()) {
            $(window).scrollTop(currentscroll);
       }
    });
    Through the above code I'm able to get the desired output, but it is failing for the first time.


    Any suggestions how to handle this issue.
    Thanks in advance
Working...