I’m building a tribute page but I need help about side by side divs. I’m not sure how to put it in words, but I will try. There are two divs side by side with different heights. The left one is smaller than the right one. If you scroll down you will reach the bottom of the left one first and its position stay fixed. But then, if you still scroll down you will see the remaining contents of the right div. Here’s an example: http://tesla.aziznatour.com/ In the biography section. I’m not sure if I can do this with HTML5 and CSS3 alone. This is what I did: http://codepen.io/KairozS/pen/rWoYKN
I’ve been searching for an answer for three days. I don’t know how to search for what I’m looking for.
As far as I know this effect is not possible in just html/css. It’s most probably some js library/plugin to create this effect. I looked at the source code, but all the javascript is in one file and minifiled, so almost impossible to figure out by looking at it. Maybe try to contact the website creator and ask him how he achieved the effect
Hi, I was checking the page again. You’re right. You need Javascript to achieve that effect.
HTML and CSS look like this before you reach the bottom of the left div:
Its position is relative.
But when you reach the bottom:
Its position is fixed.
I thought you can do this without Javascript. Probabibly the Javascript function triggers when you’re at certain position of the webpage. Thank you for reply. I wanted to do this just with HTML and CSS because I wanted to keep this simple.
@vdineva Thanks for pointing out Javascript is needed. @timotheap Thanks for letting me know that scrollspy and affix exist. I’ll take a look at them in the future.