Scroll Fixed Div Upon Collision

Huggehz

New Member
I am trying to create a page with two fixed divs (div1 and div2) at the top and one div (div3) with the page content that flows naturally below. When the user scrolls and div3 reaches the bottom of div1, I want the two divs to fuse together and scroll normally. This website has the exact behavior I'm trying to replicate.I am using different z-indexes to keep the div1 and div3 above div2, and detected when div1 and div3 touch:\[code\]$(window).scroll(function(e) { var calc = $("#div3").offset().top - $("#div1").height(); if ($(this).scrollTop() >= calc) { //fuse } else { //unfuse }});\[/code\]But I can't figure out how to fuse div3 and div1 together.Thanks :)
 
Back
Top