0
我用jScrollpane製作了一個全屏滾動webste,它運行良好,但是當我嘗試使用外部鏈接滾動並從瀏覽器窗口更改爲另一個時,當我回到它,jscrollpane回到初始位置! 我不知道什麼是錯的,但這裏是我如何做到的,maintainPosition沒有解決我的問題,它似乎與焦點行動的東西,但我沒有找到任何關於它!Jscrollpane重置爲alt +標籤後的初始位置
$(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();
}
});
});