我用 jScrollpane 做了一个全屏滚动网站,一切正常,但是当我尝试使用外部链接滚动并从浏览器窗口切换到另一个时,当我回到它时,jscrollpane 回到初始位置!我不知道出了什么问题,但我是这样做的,maintainPosition 没有解决我的问题,似乎有焦点动作,但我没有找到任何关于它的东西!
$(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();
}
});
});