I've set my sidebar-first region on a fusion based theme to float when it scrolls out of view. When this happens, there is nothing left to keep the main-content area where it is on the right, so it hops left to fill in the now missing space left by the sidebar.

to remedy this, I modified the floating_block.js file to add classes both to the floating element, and its parent. Next i wrote a css rule in my theme that applies to ".floating-parent #main-content" now, when the sidebar becomes fixed position, at the same time, the main-content region gets a margin that is the same width as the sidebar to keep things from jumping around.

The patch for the js file is attached, the CSS is up to you. It'd be great to see this applied to the module, but I'll leave it up to you guys.
-Chris

CommentFileSizeAuthor
floating-block_sidebar-fix.patch1.09 KBnetw3rker

Comments

Werner’s picture

Category: feature » bug

Hello,

I had exactly the same behavior, many thanks for your patch but ... could you please explain how to apply it? This is out of my skills :)

Abhinay’s picture

Hello,

I have a simple method to do it and patch is also not required.

After giving the sidebar id in float block just add these css to your style.css file

if you are using fusion theme paste these lines directly into your css files.
#sidebar-left {
float: left !important;
}

#main-group {
float: right !important;
}

if you are using any other theme then add

{ float: left !important; } ----> for your element id given in Float block.

and ADD
{ float: right !important;} ------> to the next element id which is rendering after sidebar region.

Anonymous’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

I have the same issue using bartik theme, plus the patch is not applying. Any suggestion?

Abhinay’s picture

Try with the comment 2.

alexpott’s picture

Status: Active » Closed (won't fix)

This is due to the theme's css in this instance the best thing is probably not to float the entire sidebar or change the theme in ways similar to the suggestion in #2

jonathan_w’s picture

Issue summary: View changes

Here's another potential way to solve this issue: https://www.drupal.org/node/2256415#comment-9586695