I'm using a script that minimizes my top menu when scrolling the page down. The script is working just fine in Chrome and Safari but in Firefox it won't minimize.
Here's the page: http://smedjan.macework.se/boende/
Here's my script:
$(function(){
$('#menubar').data('size','big');
});
$(window).scroll(function(){
var $nav = $('#menubar');
if ($('body').scrollTop() > 10) {
if ($nav.data('size') == 'big') {
$nav.data('size','small').stop().animate({
height:'50px',
top:'0px'
}, 600);
}
} else {
if ($nav.data('size') == 'small') {
$nav.data('size','big').stop().animate({
height:'150px',
top:'20px'
}, 600);
}
}
});
$(function(){
$('.smedjanlogo').data('size','big');
});
$(window).scroll(function(){
var $nav = $('.smedjanlogo');
if ($('body').scrollTop() > 10) {
if ($nav.data('size') == 'big') {
$nav.data('size','small').stop().animate({
height:'50px'
}, 600);
}
} else {
if ($nav.data('size') == 'small') {
$nav.data('size','big').stop().animate({
height:'auto'
}, 600);
}
}
});