Advertisement
jiue123

Focus() and Move position Focus() into center screen

Sep 5th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.30 KB | None | 0 0
  1. if($("#intPrice").val() == ""){
  2.         alert("Choose Price");
  3.         $("#price_r").focus();
  4.             jQuery.fn.extend({
  5.             scrollToMe: function () {
  6.             var x = jQuery(this).offset().top - 400;
  7.             jQuery('html,body').animate({scrollTop: x}, 500);
  8.             }});
  9.             $('#price_r').scrollToMe();
  10.         return false;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement