Scroll through div, stick it to the bottom, then scroll next div over it Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How can I make a div stick to the top of the screen once it's been scrolled to?Check if a user has scrolled to the bottomjQuery - DIV to move with scrolling motion and stick position to top and bottom of windowSkrollr relative top-bottom fires early in chromeHow to place a div in a way the user always needs to scroll to see it?Div follow scroll issue: scroll jump back to window topDiv height percentage based but still scrollingVertical Align Content Of Div To Bottom With Scroll Bar For OverflowHow to make a div (with images content) scroll down while scrolling?fake scroll to bottom of page
Significance of Cersei's obsession with elephants?
What is homebrew?
Why aren't air breathing engines used as small first stages
Using et al. for a last / senior author rather than for a first author
Can a party unilaterally change candidates in preparation for a General election?
Most bit efficient text communication method?
What does "lightly crushed" mean for cardamon pods?
Irreducible of finite Krull dimension implies quasi-compact?
Dating a Former Employee
Do wooden building fires get hotter than 600°C?
How could we fake a moon landing now?
Trademark violation for app?
Extracting terms with certain heads in a function
How to answer "Have you ever been terminated?"
How would a mousetrap for use in space work?
また usage in a dictionary
How to find all the available tools in mac terminal?
How to react to hostile behavior from a senior developer?
First console to have temporary backward compatibility
What is the meaning of the new sigil in Game of Thrones Season 8 intro?
Why didn't Eitri join the fight?
Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?
Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?
An adverb for when you're not exaggerating
Scroll through div, stick it to the bottom, then scroll next div over it
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How can I make a div stick to the top of the screen once it's been scrolled to?Check if a user has scrolled to the bottomjQuery - DIV to move with scrolling motion and stick position to top and bottom of windowSkrollr relative top-bottom fires early in chromeHow to place a div in a way the user always needs to scroll to see it?Div follow scroll issue: scroll jump back to window topDiv height percentage based but still scrollingVertical Align Content Of Div To Bottom With Scroll Bar For OverflowHow to make a div (with images content) scroll down while scrolling?fake scroll to bottom of page
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm trying to let the user scroll to the bottom of a div of information, then freeze the div and have the next div scroll over it. I have tried ScrollMagic and waypoints, but neither is doing what I want. What happens is, when I reach the bottom of the history, the books div jumps to the top of the page. Anyone have any ideas please? The problem might partly to have to do with the fact that my first element, the video, has fixed positioning as well.
html:
<div id="video-bg" ><!-- a fixed position background video -->
<video autoplay muted loop id="">
<source src="video/loop2.mp4" type="video/mp4">
</video>
<!-- some stuff here like the title that goes over the video -->
</div>
<div class="screen position-down-1-screen auto-height" id="history">
<!--a big page of history information-->
</div>
<div class="screen" id="books">
<!-- a big image that takes up the whole screen-->
<img src="img/page-of-books.jpg" />
</div>
css:
#video-bg
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
height: 100%;
#video-bg > video
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
.screen
position: relative;
width: 100%;
height: 100%;
margin: -2px auto 0 auto;
display: inline-block;
.position-down-1-screen
margin-top: 100%;
.auto-height
height: auto;
#books
margin-top: 100vh; /* do I need this?? */
.stuck-bottom /* is this right? */
position:fixed;
bottom:0;
ScrollMagic method:
var scene = new ScrollMagic.Scene( //have books go over history
triggerElement: "#history",
duration: length, //no idea what to put here
triggerHook: 0,
).setPin("#history")
.addTo(controller);
waypoints method:
var waypoint = new Waypoint(
element: document.getElementById('history'),
handler: function(direction)
//alert('Bottom of element hit bottom of viewport')
if (direction == 'down')
$('#history').addClass('stuck-bottom');
if (direction == 'up')
,
offset: 'bottom-in-view'
)
scroll jquery-waypoints scrollmagic
add a comment |
I'm trying to let the user scroll to the bottom of a div of information, then freeze the div and have the next div scroll over it. I have tried ScrollMagic and waypoints, but neither is doing what I want. What happens is, when I reach the bottom of the history, the books div jumps to the top of the page. Anyone have any ideas please? The problem might partly to have to do with the fact that my first element, the video, has fixed positioning as well.
html:
<div id="video-bg" ><!-- a fixed position background video -->
<video autoplay muted loop id="">
<source src="video/loop2.mp4" type="video/mp4">
</video>
<!-- some stuff here like the title that goes over the video -->
</div>
<div class="screen position-down-1-screen auto-height" id="history">
<!--a big page of history information-->
</div>
<div class="screen" id="books">
<!-- a big image that takes up the whole screen-->
<img src="img/page-of-books.jpg" />
</div>
css:
#video-bg
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
height: 100%;
#video-bg > video
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
.screen
position: relative;
width: 100%;
height: 100%;
margin: -2px auto 0 auto;
display: inline-block;
.position-down-1-screen
margin-top: 100%;
.auto-height
height: auto;
#books
margin-top: 100vh; /* do I need this?? */
.stuck-bottom /* is this right? */
position:fixed;
bottom:0;
ScrollMagic method:
var scene = new ScrollMagic.Scene( //have books go over history
triggerElement: "#history",
duration: length, //no idea what to put here
triggerHook: 0,
).setPin("#history")
.addTo(controller);
waypoints method:
var waypoint = new Waypoint(
element: document.getElementById('history'),
handler: function(direction)
//alert('Bottom of element hit bottom of viewport')
if (direction == 'down')
$('#history').addClass('stuck-bottom');
if (direction == 'up')
,
offset: 'bottom-in-view'
)
scroll jquery-waypoints scrollmagic
add a comment |
I'm trying to let the user scroll to the bottom of a div of information, then freeze the div and have the next div scroll over it. I have tried ScrollMagic and waypoints, but neither is doing what I want. What happens is, when I reach the bottom of the history, the books div jumps to the top of the page. Anyone have any ideas please? The problem might partly to have to do with the fact that my first element, the video, has fixed positioning as well.
html:
<div id="video-bg" ><!-- a fixed position background video -->
<video autoplay muted loop id="">
<source src="video/loop2.mp4" type="video/mp4">
</video>
<!-- some stuff here like the title that goes over the video -->
</div>
<div class="screen position-down-1-screen auto-height" id="history">
<!--a big page of history information-->
</div>
<div class="screen" id="books">
<!-- a big image that takes up the whole screen-->
<img src="img/page-of-books.jpg" />
</div>
css:
#video-bg
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
height: 100%;
#video-bg > video
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
.screen
position: relative;
width: 100%;
height: 100%;
margin: -2px auto 0 auto;
display: inline-block;
.position-down-1-screen
margin-top: 100%;
.auto-height
height: auto;
#books
margin-top: 100vh; /* do I need this?? */
.stuck-bottom /* is this right? */
position:fixed;
bottom:0;
ScrollMagic method:
var scene = new ScrollMagic.Scene( //have books go over history
triggerElement: "#history",
duration: length, //no idea what to put here
triggerHook: 0,
).setPin("#history")
.addTo(controller);
waypoints method:
var waypoint = new Waypoint(
element: document.getElementById('history'),
handler: function(direction)
//alert('Bottom of element hit bottom of viewport')
if (direction == 'down')
$('#history').addClass('stuck-bottom');
if (direction == 'up')
,
offset: 'bottom-in-view'
)
scroll jquery-waypoints scrollmagic
I'm trying to let the user scroll to the bottom of a div of information, then freeze the div and have the next div scroll over it. I have tried ScrollMagic and waypoints, but neither is doing what I want. What happens is, when I reach the bottom of the history, the books div jumps to the top of the page. Anyone have any ideas please? The problem might partly to have to do with the fact that my first element, the video, has fixed positioning as well.
html:
<div id="video-bg" ><!-- a fixed position background video -->
<video autoplay muted loop id="">
<source src="video/loop2.mp4" type="video/mp4">
</video>
<!-- some stuff here like the title that goes over the video -->
</div>
<div class="screen position-down-1-screen auto-height" id="history">
<!--a big page of history information-->
</div>
<div class="screen" id="books">
<!-- a big image that takes up the whole screen-->
<img src="img/page-of-books.jpg" />
</div>
css:
#video-bg
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: hidden;
height: 100%;
#video-bg > video
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
.screen
position: relative;
width: 100%;
height: 100%;
margin: -2px auto 0 auto;
display: inline-block;
.position-down-1-screen
margin-top: 100%;
.auto-height
height: auto;
#books
margin-top: 100vh; /* do I need this?? */
.stuck-bottom /* is this right? */
position:fixed;
bottom:0;
ScrollMagic method:
var scene = new ScrollMagic.Scene( //have books go over history
triggerElement: "#history",
duration: length, //no idea what to put here
triggerHook: 0,
).setPin("#history")
.addTo(controller);
waypoints method:
var waypoint = new Waypoint(
element: document.getElementById('history'),
handler: function(direction)
//alert('Bottom of element hit bottom of viewport')
if (direction == 'down')
$('#history').addClass('stuck-bottom');
if (direction == 'up')
,
offset: 'bottom-in-view'
)
scroll jquery-waypoints scrollmagic
scroll jquery-waypoints scrollmagic
asked Mar 8 at 18:58
LauraNMSLauraNMS
1,09962048
1,09962048
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069387%2fscroll-through-div-stick-it-to-the-bottom-then-scroll-next-div-over-it%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069387%2fscroll-through-div-stick-it-to-the-bottom-then-scroll-next-div-over-it%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown