0
Welcome Guest! Login
0 items Join Now

Resizing sidebar according to content

  • Resizing sidebar according to content

    Posted 12 years 7 months ago
    • Hi,

      Is there a way to set the height of the sidebar-a module according to the height of the main content? Here is the website I am working on: nacoej.org/new .

      What I've been doing is just creating a new sidebar-a module and manually setting the height. That's not a problem for me, but I'm about to hand over the keys to this site to the client, and I think that's going to be an issue.

      I've seen some javascript on the web, but I've not been able to get it working. Someone had mentioned jQuery here: forum.joomla.org/viewtopic.php?p=2202412 . But I don't even know where to put that code.

      Any ideas?
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Resizing sidebar according to content

    Posted 12 years 7 months ago
    • Add this script to the page:
      $$('#rt-sidebar-a .box4 .rt-block').adopt( new Element( 'div', { styles: { width: '100%', marginBottom: '100%' } } ) );
      What it's doing is, it adds a div to the sidebar which has margin-bottom set to 100%, so it pushes the sidebar as far as the content goes. And that's it. 8)
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
  • Re: Resizing sidebar according to content

    Posted 12 years 7 months ago
    • Excuse my ignorance, but I don't know where to put this script. Do I add it to the index.php file?
    • Shazdeh's Avatar
    • Shazdeh
    • Elite Rocketeer
    • Posts: 4984
    • Thanks: 29

    Re: Resizing sidebar according to content

    Posted 12 years 7 months ago
    • You can simply add it to the bottom of index.php file, just before the
      </body>
      tag. Also, wrap it in a <script> tag and it should work fine.
    • Please don't PM unless requested ;)
      Consider using the custom stylesheet for all your CSS customizations: gantry-framework.org/documentation/wordp...custom_stylesheet.md .
      Please provide the URL to the issue.
      And please mark the thread as solved if the issue is resolved.
  • Re: Resizing sidebar according to content

    Posted 11 years 2 months ago
    • I tried adding : $$('#rt-sidebar-a .box1 .rt-block').adopt( new Element( 'div', { styles: { width: '100%', marginBottom: '100%' } } ) );

      and wrapping it in <script> tags at: iarc-germany.com/j35/index.php/ueber-unt...tuetzte-reproduktion

      But I'm not seeing any extra height in the sidebar.

      Also, I am using the module class suffix of: nopaddinall

      And instead of box4, I have a custom css for box1

      any insights would be most appreciated.
    • Google Analytics Certified Individual.

Time to create page: 0.071 seconds