Forum Moderators: not2easy

Message Too Old, No Replies

Floating div that stops at the footer

floating div (position: fixed)

         

Mo_T

7:41 pm on Aug 19, 2014 (gmt 0)

10+ Year Member



Hi,
I know how to create a floating div with position: fixed; and bottom: 0px;
the div is floating when the page is scrolled, but how can the div stop scrolling at a certain point? (let's say 200px from the end of the page.

Thanks

brandozz

9:51 pm on Aug 19, 2014 (gmt 0)

10+ Year Member



Just change:

bottom: 0;

to

bottom: 200px;

Mo_T

3:41 am on Aug 20, 2014 (gmt 0)

10+ Year Member



maybe I wasn't clear enough,
I'm talking about a long page, I want to a floating div with NO margin in the bottom, and I want it to stop floating when it reaches that last 200px of the screen.
(I know it's possible, i've seen it before, just can't find it)

Mo_T

3:53 am on Aug 20, 2014 (gmt 0)

10+ Year Member



OK, found it on JSfiddle,
this is the demo if someone is interested (with JQuery:
[jsfiddle.net...]