Jscrollpane在alt + tab后重置为初始位置

时间:2012-07-30 20:58:48

标签: jquery focus jscrollpane

我使用jScrollpane创建了一个全屏滚动webste,它运行良好,但当我尝试使用外部链接滚动并从浏览器窗口更改为另一个时,当我回到它时,jscrollpane回到初始位置! 我不知道什么是错的,但这就是我如何制作它,维护位置没有解决我的问题,它似乎有焦点动作,但我没有找到任何关于它的事情!

$(document).ready(function(){
    w = $(window).width();
    h = $(window).height();
    $('.fullContent').css('width', w);
    $('.fullContent').css('height', h).find('.bg, .lente').css('height', h);
    $('.fullContent').jScrollPane({
        verticalDragMinHeight: 30,
        verticalDragMaxHeight: 30,
        horizontalDragMinWidth: 161,
        horizontalDragMaxWidth: 161,
        maintainPosition: true,
        animateScroll: true,
        hijackInternalLinks: true
    }).bind('jsp-scroll-x', function(event, scrollPositionX, isAtLeft, isAtRight){
        $('.lente').css('left', scrollPositionX*0.6);
        //console.log('Bg = '+scrollPositionX, 'Lente = '+scrollPositionX*0.6);
    });
    var throttleTimeout;
    $(window).bind('resize', function(){
        w = $(window).height();
        h = $(window).height();
        $('.fullContent').css('width', w);
        $('.fullContent').css('height', h).find('.bg, .lente').css('height', h);
        if($.browser.msie) {
            if(!throttleTimeout) {
                throttleTimeout = setTimeout(function(){
                    $('.fullContent').data('jsp').reinitialise();
                    throttleTimeout = null;
                },50);
            }
        }else{
            $('.fullContent').data('jsp').reinitialise();
        }
    });
});

1 个答案:

答案 0 :(得分:1)

我评论了第908行,函数initFocusHandler,它停止了做这个有趣的事情!

        function initFocusHandler()
        {console.log(30)
            pane.find(':input,a').unbind('focus.jsp').bind(
                'focus.jsp',
                function(e)
                {
                    //comment here \/
                    //scrollToElement(e.target, false);
                }
            );
        }
相关问题