Welcome to WebmasterWorld Guest from 34.204.191.31

Forum Moderators: not2easy

Message Too Old, No Replies

Floating div that stops at the footer

floating div (position: fixed)

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

New User

5+ Year Member

joined:June 17, 2012
posts: 36
votes: 0


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
9:51 pm on Aug 19, 2014 (gmt 0)

Junior Member

5+ Year Member

joined:June 6, 2012
posts: 104
votes: 0


Just change:

bottom: 0;

to

bottom: 200px;
3:41 am on Aug 20, 2014 (gmt 0)

New User

5+ Year Member

joined:June 17, 2012
posts: 36
votes: 0


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)
3:53 am on Aug 20, 2014 (gmt 0)

New User

5+ Year Member

joined:June 17, 2012
posts: 36
votes: 0


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