How to make a floating block on the right?

Hello, please tell me the version of the working script, which was recorded on the right when you scroll, it was stopped when he reached the labels ,for example <div class="metka"></div> because I don't know in advance what will be the height of the footer, there is dynamic data and I don't know the height of the cap, in General, is it possible to install 2 diva in the role of the label top and bottom and between the floating unit that would stay when you scroll in front of them, does anybody have a solution ready?
April 7th 20 at 11:04
1 answer
April 7th 20 at 11:06
I can not understand
standard position: fixed is not suitable?
if the position of the top and bottom are not known, the margin from the borders of the still famous? When you scroll to the top or bottom of the page, you can change the position to relative.
@magnus.Carter, can you tell me how to do it simplified? - Jody87 commented on April 7th 20 at 11:09

Find more questions by tags JavaScript