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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:38:40+00:00 2026-05-27T06:38:40+00:00

I’m trying to create a social media panel that sits next to the title

  • 0

I’m trying to create a social media panel that sits next to the title of a blog post (about 200px or so from the top of the viewport) and when the user scrolls down the page I want the panel to have a fixed position only when the top of the social panel hits the top of the viewport. An example of what I’m trying to do is any post on Mashable’s website, for instance: http://mashable.com/2011/12/05/facetones/. Notice how the social media panel on the left of the content panel scrolls with the page until it hits the top of the browser viewport, and then it becomes fixed. Any tutorial explaining how to do this with pure CSS or (better yet) jQuery would be greatly helpful, as I was not able to find anything myself. I guess I just didn’t even know how to start searching for such a thing.

Currently I have figured out how to setup my HTML/CSS to display the social media panel fixed to the page beside the content panel and it works perfectly, but I’d like for it to scroll up with the page and THEN become fixed when it hits the top of the viewport as mentioned above, instead of staying fixed exactly to the page without scrolling at all as my code currently does. Here’s my code so far:

HTML:

<div id="fixed">

    <div id="sharebox-wrapper">

        <div id="sharebox">

            <div class="inner">

                share

            </div>

        </div>

    </div>

</div>

CSS:

#fixed {position:fixed;}
#sharebox-wrapper {position:relative;left:0px;top:0px;}
#sharebox {width:100px;background:#F3F3F3 url(images/sharebox-bg.png) repeat-y right 0px;border:1px solid #CFCFCF;border-right:0px;position:absolute;left:-116px;top:25px;height:400px;}
#sharebox .inner {padding:12px;}
  • 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-27T06:38:41+00:00Added an answer on May 27, 2026 at 6:38 am

    It is really pretty simple. Create a class that describes the fixed positioning. Monitor the scroll event of the window. If the top of the social media are going to go off screen, switch it to fixed. If not, let it position itself normally. I just wrote this, but it should work.

    http://jsfiddle.net/zpErD/1/

    var mediaTop = $('div#sharebox-wrapper').offset().top; 
    var media = $('div#sharebox-wrapper');
    
    $(document).scroll( function() {
       var scrollTop = $(document).scrollTop();
    
       //fix/unfix as necessary
       if (mediaTop < scrollTop) {
           $(media).addClass('fixed'); 
       }
       else { 
           $(media).removeClass('fixed'); 
       }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.