IOS ipad and iphone jumping bug when focused on input (due to keyboard popingup)

IOS ipad and iphone jumping bug when focused on input (due to keyboard popingup)

Hey guys i have made the following demo here.

basically when a user clicks on the input , the entire form goes out of view , this happens as the keyboard popups up , i have checked SO and other sites for solutions , and currently have the following solution applied in the live site:


  1.   $('form input').on('focusin focus', function(e) {
  2.     $this = $(this);
  3.     $('html , body').animate({
  4.       scrollTop: ($this.offset().top / 2)
  5.     }, 0);
  6.   });
ofcourse this works perfectly if applied on the desktop version of the site , but on IOS there is a huge jitter everytime the user tabs to a new input field. is there a workaround to this ??