I've got this simple script to show a floating menu. I want it to stop about 100px from the bottom, thanks.

function moveFloatMenu() {
    var menuOffset = menuYloc.top + $(this).scrollTop() + "px";
menuYloc = $('#floatMenu').offset();


  • Thanks Matt, but that just pushed it up another 200px. Anyway, I found a solution from another Jquery plugin: http://plugins.jquery.com/project/stickyfloat Alvin Tan over 9 years ago

1 answer


You should be able to just modify the var menuOffset to subtract the height of your footer + 100px or so.

For example, say the footer has a height: 100px, you could modify to be:

    var menuOffset = menuYloc.top + $(this).scrollTop() - 200 + "px";

You should be able to mess around with the amount you are subtracting to suit your needs.

Here's a quick example just to make sure I'm understanding what you're trying to do: http://pastebin.me/43955a489061d7bd27f1c1aecffc8e3f

Answered over 9 years ago by Matt Crest