Issue with full page horizontal scroll

陌路散爱 提交于 2019-12-09 16:48:24

问题


Is any other alternative for full page scroll?

example of full page scroll

http://jscrollpane.kelvinluck.com/fullpage_scroll.html

step-1 make window width smaller by clicking Restore down button.

step-2 scroll to right

step-3 now, make window width bigger by clicking Maximize button.

now, page is left aligned

jQuery

 $(function()
{
    var win = $(window);

    win.bind(
        'resize',
        function()
        {

                var container = $('#full-page-container');

                container.css(
                    {
                        'width': 1,
                        'height': 1
                    }
                );

                container.css(
                    {
                        'width': win.width(),
                        'height': win.height()
                    }
                );
                isResizing = false;
                container.jScrollPane(
                    {
                        'showArrows': true
                    }
                );

        }
    ).trigger('resize');


    $('body').css('overflow', 'hidden');


    if ($('#full-page-container').width() != win.width()) {
        win.trigger('resize');
    }


});

CSS

html
{
    overflow: auto;
}
#full-page-container
{
    overflow: auto;
}

回答1:


The thing here is that jScrollPane adds jspPane a left:-***px when you scroll to the right. And never undoes the damage.

If you would add:

$('#full-page-container .jspPane').css('left', 'auto');

In your resize, it will work. Although I suggest you report a bug for jScrollPane guys as well.



来源:https://stackoverflow.com/questions/14078587/issue-with-full-page-horizontal-scroll

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