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

The Archive Base Latest Questions

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

I saw a cool style/js function (I can tell what it is) that implemented

  • 0

I saw a cool style/js function (I can tell what it is) that implemented on a side menu.
You know the situation when you have a long center page and one of / both of you sides ends and that leave a blank space? Well this site implemented this thing that just when the user scrool to the place where the side menu end – the menu get absolute postion and doesnt move.

How can I do this?

If you want to see an example you can look here (just scroll and look on the sides)

  • 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-22T12:20:33+00:00Added an answer on May 22, 2026 at 12:20 pm

    I believe you can achieve similar effect using this: http://www.wduffy.co.uk/blog/keep-element-in-view-while-scrolling-using-jquery/comment-page-1/ (just making it move with 0 as speed parameter instead of slow, as in the example) and adding conditions about whether the current position fits within the box it is displayed (you can take height of the box – menu being moved on page or box that contains the menu – by using .height() jQuery function).

    EDIT:

    The page you referenced uses the following JavaScript code to support what you try to accomplish:

    <script type="text/javascript">
        $(function(){
            var seoHeight =  $$('dvIndexSeoMaster').height();
                seoHeight = (seoHeight > 0) ?  seoHeight : 0; 
            var documentHeight = $(document.body).height() - 120 - seoHeight;
            var fixedMode = false;
            var hasFixedClass = false;
            var leftColElm = $sc('dvFixed');
            var leftColPos = leftColElm.offset().top;
            var leftColHeight = leftColElm.height();
            var rightColElm = $$('dvIndexMasterRightCol');
            var rightColPos = rightColElm.offset().top;
            var rightColHeight = rightColElm.height();
            function scrollElm(elmPos,elmHeight,objElm, cssClass){
                var fixedMode = false;
                var hasFixedClass = false;
                var windowTop = $(window).scrollTop();
                (windowTop >= elmPos && (windowTop + elmHeight) < documentHeight) ? fixedMode = true : fixedMode = false;
                if( fixedMode){
                    $(objElm).addClass(cssClass);
                    hasFixedClass = true;
                }else if( (fixedMode == false)){
                    $(objElm).removeClass(cssClass);
                    hasFixedClass = false;
                }
            };
            $(window).scroll(function(){
                scrollElm(leftColPos,leftColHeight,leftColElm,'make-fixed');
                scrollElm(rightColPos,rightColHeight,rightColElm, 'make-fixed');
            });
        });
    </script>
    

    And the make-fixed CSS class has the following definition:

    .make-fixed {
        position: fixed;
        top: 0;
        z-index: 200;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just saw a really cool WPF twitter client that I think is developed
I saw that __VIEWSTATE field gets rendered even though I have set the EnableViewState=false
I saw this same question for VIM and it has been something that I
I just saw this cool feature of JQuery which is JQuery Portlet http://jqueryui.com/demos/sortable/portlets.html I
I just saw that the newer wordpress (newer meaning since the last time I
I'm porting some MATLAB functions to Scilab . The cool thing is that there
Saw this www.workatplay.com/ website, and got fascinated on how simple and nice stuff can
I saw the following usage of jQuery selector: $('[value=]', event.target).remove(); I can guess the
i saw comment like this one place i have seen this problem is if
I saw some software the other day that logs all keystrokes that are typed

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.