I am trying to build a floating menu that follows the user when he scrolls the screen:
menuYloc = parseInt($("#floatMenu").css("top").substring(0,$("#floatMenu").css("top").indexOf("px")));
$(window).scroll(function() {
var offset = menuYloc+$(document).scrollTop()+"px";
$("#floatMenu").animate({top:offset},{duration:500,queue:false});
});
This works perfectly fine in Firefox but does not work in Chrome. Is there anything I am missing?