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 3999022
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:36:09+00:00 2026-05-20T07:36:09+00:00

recently for a website I am working on I wanted to create a horizontal

  • 0

recently for a website I am working on I wanted to create a horizontal divider capable of resizing two elements on a page using jquery.

Basically:

Content

___Divider_____

Content

When: the divider is dragged, it should resize the “Content” elements either side of it to the users desired size.

Here is what i have so far.

<div id="WorkRequests"></div>
<div id="Divider" style="height:10px; padding:5px; cursor:n-resize;"><hr /></div>
<div id="WorkRequest_Ajax"></div>

And the script:

var totalHeight = $("#Divider").parent().height();
    function ResizePage(divPosition) {
        var validDrag = true;

        // Math
        var minPercent = totalHeight * 0.25;
        var minBuffer = totalHeight * 0.05;
        var topHeight = divPosition.top - $("#content").position().top;
        var bottomHeight = (totalHeight - divPosition.top);

        // Check Drag
        if (topHeight < minPercent) {
            validDrag = false;
            $("#WorkRequests").height(minPercent + minBuffer);
        }

        if (bottomHeight < minPercent) {
            validDrag = false;
            $("#WorkRequest_Ajax").height(minPercent + minBuffer);
        }

        // Set Heights
        if (validDrag) {
            $("#WorkRequests").height(topHeight);
            $("#WorkRequest_Ajax").height(bottomHeight);
        }

        return validDrag;
    }

    $("#Divider").draggable({ axis: "y", drag: function (event, ui) { return ResizePage($(this).position()); } });

However when I drag the divider it simply jumps around and locks at either extremity, I have tried many different calculations etc, but I am afraid I just simply do not understand the factors in resizing both elements.

So does anyone know a jquery plugin that will do this for me, or how i can fix my attempt?

Thanks,
Alex.

  • 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-20T07:36:10+00:00Added an answer on May 20, 2026 at 7:36 am

    You may also checkout the UI.Layout jQuery plugin. Here’s a demo.

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

Sidebar

Related Questions

Recently I'm working with jQuery UI Carousel (1.0.2) on my Drupal website. So far
Recently I installed a certificate on the website I'm working on. I've made as
I'm working with an external team with our website and they recently added one
I've been using Amazon EC2 for hosting a recently released website, mainly to gauge
I recently put together a website exclusively using a computer with a wide screen
Hello recently I am using sweet pages pagination for my website. I want to
Iam a web-developer and recently i have completed and launched a website (im using
My website was recently attacked by, what seemed to me as, an innocent code:
I recently moved my website to a shared hosting solution at asmallorange.com , but
I recently migrated a website to a new CMS (Umbraco). A lot of the

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.