I have a strange problem which I cannot get my head around, I have created a sticky nav via jquery which works fine in all browsers but Chrome and Safari, sometimes it works and sometimes it doesn't if you refresh the page. Most of the time the menu jumps to the top of the page as soon as you start browsing. You can view the problem here: http://debourg-dev.ch/syselcloud/syselbackup/

The jQuery concerned is:
Code:
	var yOffset = $("#local-nav-wrapper").offset().top;
	$(window).scroll(function() {
		if ($(window).scrollTop() > yOffset) {
			$("#local-nav-wrapper").css({
				'top': '0',
				'bottom': 'auto',
				'position': 'fixed',
			});
		} else {
			$("#local-nav-wrapper").css({
				'top': 'auto',
				'bottom': '0',
				'position': 'absolute',
			});
		}
	});
Any help would be greatly appreciated.