By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,591 Members | 647 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,591 IT Pros & Developers. It's quick & easy.

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

P: 6
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,
Expand|Select|Wrap|Line Numbers
  1. var currentscroll = 0;
  2. $('input, textarea').bind('focus',function() {
  3.    currentscroll = $(window).scrollTop();
  4. });
  5. $('input, textarea').bind('blur',function({
  6.    if(currentscroll != $(window).scrollTop()) {
  7.         $(window).scrollTop(currentscroll);
  8.    }
  9. });
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
Nov 28 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.