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 5943109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:20:54+00:00 2026-05-22T16:20:54+00:00

I have a CSS layout as in the attached picture. I’d like to achieve

  • 0

I have a CSS layout as in the attached picture.
enter image description here
I’d like to achieve the following behaviour

  1. When part of the header is visible the positions (when scrolling) are as in the picture.
  2. When header is invisible (we’re scrolling down more then header length), the positions of left, right and img should be fixed and the only scrollable part should be page content.

So far fiddle link

Liam suggested this link but javascript has error Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function . Maybe it’s related to the mootools (I’m not using it). Is this functionality possible without mootols?

Could you help me with positioning style of this?

thank you

  • 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-05-22T16:20:54+00:00Added an answer on May 22, 2026 at 4:20 pm

    Tested this, works fine

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
      "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript"
      src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js">
    </script>
    <script type="text/javascript">
    //<![CDATA[
    window.onscroll = function()
    {
        if( window.XMLHttpRequest ) {
            if (document.documentElement.scrollTop > 221 || self.pageYOffset > 221) {
                $('rightsidebar').style.position = 'fixed';
                $('rightsidebar').style.top = '0';
                $('leftsidebar').style.position = 'fixed';
                $('leftsidebar').style.top = '0';
            } else if (document.documentElement.scrollTop < 221 || self.pageYOffset < 221) {
                $('rightsidebar').style.position = 'absolute';
                $('rightsidebar').style.top = '221px';
                $('leftsidebar').style.position = 'absolute';
                $('leftsidebar').style.top = '221px';
            }
        }
    }
    //]]>
    </script>
    <style type="text/css">
    /*<![CDATA[*/
    body {margin:0;
    }
    #header {background:blue; height:221px;}
    #rightsidebar {
            position:absolute;
            right: 0;
            top: 221px;
            width: 150px;
            color: #FFFFFF;
            background:red;
    }
    
    #leftsidebar {
            position:absolute;
            left: 0;
            top: 221px;
            width: 150px;
            color: #FFFFFF;
    }
    #topleft {background:green;}
    #image {background:red;}
    #footer {height:100px; background:yellow;}
    /*]]>*/
    </style>
    <title></title>
    </head>
    <body>
    <div id="header">header</div>
    <div id="leftsidebar">
    <div id="topleft">lkjlk</div>
    <div id="image">IMAGE</div>
    </div>
    <div id="content"><br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br /></div>
    <div id="rightsidebar">lkjlk</div>
    <div id="footer">Footer</div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CSS layout as in this picture. I'd like to achieve the
I have the following css layout (see pic below) and would like to know
I have a quite complicated HTML/CSS layout which I would like to convert to
I have following css code for layout. td img {display: block;} While displaying images
I have a CSS layout that simulates a fixed-frame page, with a header and
Guys, I have a CSS Layout that I am using that has a header,
I have some layout css questions. Their more like best practices and whats the
I have css code to do layout. i have basic header panel, footer, left
basicaly I have the following HTML/CSS Layout HTML: <div id=container> <div id=main> <h1>TEST</h1> </div>
I'm using Drupal 6 and have created 2 equal columns in layout.css In the

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.