use bootstrap "affix" instead of own jQuery Code

... to make the sticky navigation bar