问题
The website I'm working on has a wide main content block that doesn't fully fit inside the smaller resolution screen.
http://www.cybart.com/bscg/
I want to use jQuery to force the horizontal scrollbar to appear scrolled to the middle, so that a user who has a smaller resolution screen can scroll to the left and access the menu that would otherwise be hidden.
I would be grateful for the expertly advice!
回答1:
If you use scrollTo plugin, you can say: $(...).scrollTo( '50%', {axis: 'x'} );
来源:https://stackoverflow.com/questions/6755979/jquery-set-horizontal-scrollbar-in-the-middle-to-enable-scrolling-to-the-left