Solved

Sticky sidebar pops out

Posted on 2013-05-12
4
303 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

911 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

23 Experts available now in Live!

Get 1:1 Help Now