Skip to content

Instantly share code, notes, and snippets.

@burners77
Created March 14, 2013 23:38
Show Gist options
  • Save burners77/5166248 to your computer and use it in GitHub Desktop.
Save burners77/5166248 to your computer and use it in GitHub Desktop.
Floating Menu JS
// JavaScript Document
$(function(){
$(function() {
function moveFloatMenu() {
var menuOffset = menuYloc.top + $(this).scrollTop() + "px";
$('#floatMenu').animate({
top: menuOffset
}, {
duration: 700,
queue: false,
easing: 'easeOutBounce',
});
}
menuYloc = $('#floatMenu').offset();
$(window).scroll(moveFloatMenu);
moveFloatMenu();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment