I made a fullscreen scroll webste with jScrollpane, it’s all working well, but when I try to scroll with a external link and change from browser window to another one, when I come back to it, jscrollpane goes back to initial position!
I have no idea whats wrong but here is how I made it, maintainPosition didn’t solved my problem, it seems something with focus action, but I didn’t find anything about it!
$(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();
}
});
});
I commented the line 908, function initFocusHandler, and it stopped doing this anoying thing!