Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:17:09+00:00 2026-05-31T05:17:09+00:00

I have 3 divs arrranged like – ————————– | f | headlineDiv | |

  • 0

I have 3 divs arrranged like –

    --------------------------
    |  f      |  headlineDiv  |
    |  i      |               |<- draggable and resizable
    |  l      |_______________|
    |  t      |               |
    |  e      |               |<- draggable and resizable
    |  r div  |  storyDiv     |
    |--------------------------
        ^
        |
    can be hidden

Heres some code :

 <div id="main">
    <div id="showFiltersDiv">
    </div>
    <div id="filtersDiv">
        <div id="hideTextDiv">
        </div>
    </div>
    <div id="contentDiv">
        <div id="headlineDiv">
            Block 1</div>
        <div id="storyDiv">
            Block 2</div>
    </div>
</div>

heres the jquery code:
for Resize ->

            $('#headlineDiv').resize(function () {
            var offset = $('#headlineDiv').position();
            var height = $('#headlineDiv').height();
            var width = $('#contentDiv').width();
            var top = offset.top + height + "px";
            var newStoryHeight = $("#main").height() - $("#headlineDiv").height();
            var maxHeight = $("#main").height();

             $('#storyDiv').css({
                'bottom': 0,
                'height': newStoryHeight,
                'top': top,
                'position': 'absolute',
                'width': width
            });

            $('#headlineDiv').css({
                'max-height': maxHeight,
                'width': width
            });
        });

The code for #storyDiv is similar

Heres the code that should make them expand to fit the extra space –

             $('#showFiltersDiv').click(function () {
            $('#filtersDiv, #hideTextDiv').show("slide", { direction: "left" });
            $('#showFiltersDiv').hide();
            var left_margin = $('#filtersDiv').width();
            var perm_width = $('#main').width() - left_margin;               
            var storyTop = $('#storyDiv').position().top;
            $('#headlineDiv').width(perm_width);
            $('#headlineDiv').css({
                'float': 'right',
                'left': $('#main').width() - perm_width,
                'position': 'absolute'
                //'width': perm_width
            });

            $('#storyDiv').css({
                'float': 'right',
                'left': $('#main').width() - perm_width,
                'position': 'absolute',
                'width': perm_width
            });
        });

when headlineDiv is resized, storyDiv should adjust its height accordingly. Their positions are interchangeable. So if the user drags storyDiv above, headlineDiv will be placed below it. Hence, then if storyDiv is resized, headlineDiv will adjust it’s height accordingly. For some reason, when the user tries to resize either, their width decreases by around 10px. To fix this, i set the width of these divs to be equal to their parent in the resize function.

Now, filterDiv is a toggle div. So when a user hides it, headlineDiv and storyDiv should expand on the left and occupy the new space. To do that, I’m changing their width. However, setting the width with $('#headlineDiv ').width(newWidth) has no effect. Any suggestions on what could do the trick?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:17:10+00:00Added an answer on May 31, 2026 at 5:17 am

    Use jQuery UI resizeable. It has options for “alsoResize” built right in. Since rules you are providing aren’t clear you can write a simple function in “alsoResize” yourself

    http://jqueryui.com/demos/resizable/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two divs like so <div id=parent style=width:100px:overflow:hidden;> <div id=child> tooooooooooooooooooooo much content
I have three DIVs, something like this: <div id=header> ... </div> <div id=content> <div
So I have divs like this on my page: <div class=drag></div> And this jquery
I have three divs : <div id=login /> <div id=content /> <div id=menu />
I have a <div> , divided into 3 <div> s. Two of those divs
I have a page with the several divs like: By default all are display:none,
How can I style a group of related divs to look like a table
I have multiple divs, each with a unique id and image. I would like
I have 3 divs. When I click one of them, the div will disappear
I have divs created within a while loop displaying a MySQL query. I'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.