Néstor Lim Néstor Lim - 1 year ago 56
jQuery Question

Expandable sidebar (div) OVER the entire website (in background)

I was trying for 2 days how to implement a sidebar on my project, like Feedly.com sidebar

All scripts/snippets/codes I tried, destructs my design and move all divs, etc. I think the best option is to create a div OVER all my site. How can I do this??

What I have right now:

What I have right now

What I want to do:

What I want

What I want

Thanks for your time;
Best regards,

Answer Source

To create a sidebar all you need is:

.sidebar {
     /* Dimensions */
    width: 3.8em; /* adjust it to make it wider or narrower */
    height: 100%; /* to be the entire height of the window */

    /* Positioning */
    position: fixed; /* to stay fixed on the screen */
    top: 0;
    left: 0; /* Or right: 0 to put right */

    /* Visibility */
    display: inline-block;