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

  • Home
  • SEARCH
  • 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 9163299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:24:49+00:00 2026-06-17T14:24:49+00:00

$(#main .primary) .width($(this).closest(#main .row) .outerWidth(true) – $(this).closest(#main .secondary) .outerWidth(true)); ..doesn’t work at all. What

  • 0
$("#main .primary")
        .width($(this).closest("#main .row")
        .outerWidth(true) - $(this).closest("#main .secondary")
        .outerWidth(true));

..doesn’t work at all.

What I’m doing is applying the width to the primary div by subtracting the width of secondary from main (parent).

<div id="main">
    <div class="row">
        <div class="primary"></div>
        <div class="secondary"></div>
    </div>
</div>

Thanks

  • 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-06-17T14:24:51+00:00Added an answer on June 17, 2026 at 2:24 pm

    First the selector #main .row will return an empty jQuery Object,
    if you want to match the element having an id and a class together you can use it like this :

    #myId.my-class // Select by id and class
    div#myId.my-class // Select by element and the id and the class
    

    I suggest for you to use the siblings() method in your case

    $('#main .primary')
      .width( function(){ 
       return $(this).closest('.row').width() - // or you can use .parent() instead
              $(this).siblings('.secondary').outerWidth(true); 
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Main thread of application is doing some work. There also exists a timer, which
I have a small HTML problem with this code: <div id=primary> <div id=content role=main>
main.c (with all the headers like stdio, stdlib, etc): int main() { int input;
This question is about a general technique in SQL, that I can't quite work
Requirement: Example Link: http://jtstratford.advisorproducts.com/overview On this page when we hover over Main navigation then
I have googled myself almost to death over this and the closest I came
I have 3 tables that look like this: Table 1 (main table): item_id (item_id,
forgive me I just learned php this week, so I'm not sure I'm doing
I'm trying to make this many-to-many join work with Flask-SQLAlchemy and two MySQL databases,
I'm getting the following error: RangeError: Maximum call stack size exceeded. on this row:

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.