stickyfloat icon indicating copy to clipboard operation
stickyfloat copied to clipboard

add offsetTop parameter

Open designst opened this issue 10 years ago • 2 comments

Add an additional configuration parameter offsetTop to define a minimum distance to the upper edge.

designst avatar Jun 23 '14 11:06 designst

I do no understand this at all. you can do this with CSS.

yairEO avatar Jun 23 '14 11:06 yairEO

I tried to solve it with CSS but i wasn't able to.

The problem is, that i want to place a div (we call it stickyfloat-div) always on the bottom of a sidebar if there is enough space. Above the stickyfloat-div there is also a navigation (we call it navigation-div) with a dynamic height.

So if the browser window is height enough stickyfloat the stickyfloat-div to the bottom of the page on scrolling. But if the browser window isn't height enough to show the navigation-div _and_ the stickyfloat-div together, then the stickyfloat-div should be positioned below the navigation-div and perhaps outside of the browser viewport. Do not stickyfloat the stickyfloat-div until there is enough space after scrolling to fully show the stickyfloat_div below the navigation-div inside the browser viewport.

I've solved this problem with the additional offsetTop parameter. On page loading i calculate the navigation-div height which defines the offsetTop value to set a minimum distance between the browser upper edge and the stickyfloat-div.

designst avatar Jun 23 '14 13:06 designst