jQuery: Set Horizontal Scrollbar in the Middle to Enable Scrolling to the Left

纵然是瞬间 提交于 2019-12-25 00:33:41

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!