Solved

Sticky sidebar pops out

Posted on 2013-05-12
4
298 Views
Last Modified: 2013-05-13
Head over to here
Scroll down a bit and you will see the sidebar becomes sticky but it overlaps the main content - you will need your browser at 1100px or more to see it
It's like its ignoring the container width.

This is the plugin I'm using http://stickyjs.com/
0
Comment
Question by:Gary
  • 2
4 Comments
 
LVL 4

Expert Comment

by:ramyajanarthanan
Comment Utility
In your page initially position is set to static and when scrolled set to fixed.

try setting your class=left-sidebar

position:absolute;
float:left;
and left,right alignments.

I hope the problem is due to positioning.width of left bar as I'm not able to check since i don't have your exact code and on firebug on scrolling the style gets changed.
0
 
LVL 58

Author Comment

by:Gary
Comment Utility
position:absolute is not a fix - that will only mess up the whole layout.
0
 
LVL 42

Accepted Solution

by:
David S. earned 500 total points
Comment Utility
The problem is due to the percentage width interacting with how the script works. You see before you scroll down the sidebar has "position:static" but after you scroll down it has "position:fixed". "position:fixed" causes the sidebar's "positioning context" to be different, so the percentage width refers to the width of the <html> element instead of that of ".wrap". It looks like the simplest solution would be to simply give "max-width: 238px" to ".left-sidebar".
0
 
LVL 58

Author Closing Comment

by:Gary
Comment Utility
static is set by the plugin because it clones the object and it is the cloned object that has position:fixed but..
Adding a max-width fixes it, almost, it still extends a bit at smaller resolutions but I can live with that as it doesn't extend to the main content.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now