Solved

Sticky sidebar pops out

Posted on 2013-05-12
4
315 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:ramyajanarthanan
ID: 39160669
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
ID: 39161345
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
ID: 39161787
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
ID: 39162132
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 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