How to create a floating menu

You should be advised to create a floating menu that is very similar to what is used in the apple's shopping cart . I saw some scenarios that do something like this (and we tried one), but they tend to β€œlag behind” the movement, while the apple version gives a feeling of stillness. A jQuery solution would be preferable.

+3
source share
3 answers

Well, it looks like they are switching from relative positioning to fixed. It works better than most people who just scroll it more, because the window scrolls more.

You can determine how the window scrolls by following the directions in the following link .

+4
source

Once the div position is equivalent to the top of the current window, make a fixed position. You will have to use logic to make sure that it returns to non-fixed after scrolling through the backup, but it should be trivial.

+1
source

Here is a plugin called scroll-follow that will help. Essentially, you define a DIV with ul for your menu options. The plugin allows you to set the speed, appearance and toggle switch.

+1
source

Source: https://habr.com/ru/post/1706655/


All Articles