how to scroll window onload with jquery -


I have a form in the middle of the table. I want to keep this form vertically and horizontally in the middle of the window. , Even when the size of the window is smaller than the table. I'm thinking of using the jQuery scrollTo function and it calls onload and resize, but I'm a speculator and I do not know how to do it. I appreciate any help or examples with the call in the header and script function. Thanks a lot.

If you want a floater box:
insert your form into a div, this position is absolute Make this center:
Add this JQuery plugin:

  $ (document) .ready (function () {$ ('# div_id'). CSS ('position' , 'Absolute'); $ ('# div_id') .center ();}); $ (Window). Reset (function () {$ ('# div_id'). Center ();}); If you want to scroll:  
  $ (document) .ready (function () {window.scrollTo (0, $ ("# FORM_ID") .offet (). Top);} ); $ (Window). Reset (function () {window.scrollTo (0, $ ("# FORM_ID") offset (). Top);});  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -