Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8360831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:33:32+00:00 2026-06-09T11:33:32+00:00

So I have the following: <div id=TwoColumns> <div id=LeftColumn> <div id=navigation> /*This is a

  • 0

So I have the following:

<div id="TwoColumns">

    <div id="LeftColumn">
        <div id="navigation">
            /*This is a fixed navigation*/
            Anchor link here to PointOne
            Anchor link here to PointTwo
            Anchor link here to PointThree
        </div>
    </div>

    <div id="RightColumn>
        <div id="PointOne">
            Point One
        </div> 
        <div id="PointTwo">
            Point Two
        </div> 
        <div id="PointThree">
            Point Three
        </div> 
    </div>

</div>

1) What I want to do is when a user scrolls the navigation moves within the LeftColumn and follows the user down as a fixed element usually would but strictly within container only.

2) When a anchor link is clicked reposition navigation to be inline with relevant Point.

So what I am doing is setting top:0; for navigation when anchor link is clicked, the issue with doing this is that when I scroll to the top the fixed div now leaves it’s container which is LeftColumn.

I don’t mind using javascript and jquery.

UPDATE

Ok so Oswaldo Acauan html/css solution gets my 1st point ticked off.

The second issue still is an issue. When I click on link the navigation is not in-line with content on the right hand side.

enter image description here

I am getting WRONG at the moment and would like the CORRECT vision. I can’t for the life of me figure it out.

http://jsfiddle.net/BbAck/1/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:33:33+00:00Added an answer on June 9, 2026 at 11:33 am

    You can try Scrollspy by TwitterBootstrap,
    or do it with CSS/HTML and a little bit of Javascript/jQuery.

    Demo HERE

    HTML:

    <div id="Container">
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    <div id="TwoColumns">
    
        <div id="LeftColumn">
            <div id="navigation">
                This should be in line with the top of the point
                <a href="#PointOne">Anchor link here to PointOne</a>
                <a href="#PointTwo">Anchor link here to PointTwo</a>
                <a href="#PointThree">Anchor link here to PointThree</a>
            </div>
        </div>
    
        <div id="RightColumn">
            <div id="PointOne">
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div> 
            <div id="PointTwo">
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div> 
            <div id="PointThree">
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
            </div> 
        </div>
    
    </div>
    

    ​
    CSS:

    html,body { height: 100%; }
    
    #Container { overflow: hidden; }
    
    #LeftColumn {
        float: left;
        width: 50%;
    }
    
    #navigation.fix {
        position: fixed;
        top: 0;
    }
    
    #navigation a {
        display: block; 
    }
    
    #RightColumn {
        width: 50%;
        float: right;
    }
    
    #PointOne { 
        background-color: red;
        height: 159px;
    }
    
    #PointTwo { 
        background-color: green;
        height: 400px;
    }
    
    #PointThree { 
        background-color: purple;
        height: 650px;
    }
    

    ​
    JS:

    $(window).scroll(function() {
        yOffset = window.pageYOffset;
        yContainer = $('#Container').height() - $('#RightColumn').height();
        if (yOffset >= yContainer) {
            $('#navigation').addClass('fix');
        } else {
            $('#navigation').removeClass('fix');
        }
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following div <div id=acc> <a href=#>Link 1</a> <div> Some Content </div>
I have the following XPath: //div[contains(@id, 'box')]/div/h4/small/a[contains(@href, 'google')]/@href When I try out this XPath
I have the following div structure, but this structure is changing <div class=rt-container> <div
Q: I have the following case : Div contains a link , i wanna
I have the following div tag: <div id=headerimage></div> associated with this is the following
I have following div in a page (I can not modify). <div id=:0.control>Click me</div>
I have a following div structure <div id=wrapper> <div id=header> <div id=storeFinder> /* html
I have the following div <body> <span style=border:1px solid red; display:inline-block> Some text<br />
I have the following div and paragraphs: <div id=container> <p class=jsavoutput jsavscroll readonly=readonly style=width:225px;
How to wrap one div around another? I have following two div ids: #course

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.