Such a task: when loading a page (if there is a horizontal scroll) move the visible area in the center (horizontally). Used the scrollTo library.

jQuery(document).ready(function(){ jQuery.scrollTo({"left": "50%"}); }); 

but something is not working.

    2 answers 2

    http://jsfiddle.net/QR7sa/4/

      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script> <style> #box { width: 5000px; height: 100px; background-color: #Aff; } </style> <body> <div id="box"></div> <script> $(document).ready(function(){ var scroll = ( document.documentElement.scrollWidth - $(window).width() )/2; if(document.documentElement.scrollWidth > $(window).width() ) { $(document).scrollLeft(scroll); } }); </script> </body> 
       $(document).ready(function(){ left_scr = ($(document).width() - $(window).width())/2; $(document).scrollLeft(left_scr); }); 

      Information from here: http://forum.enterin.ru/thread-3.html