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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:27:31+00:00 2026-06-10T05:27:31+00:00

I create one div#sresult_container dynamically and append no of div to that div. and

  • 0

I create one div#sresult_container dynamically and append no of div to that div. and all appended div have different text. so i can retrieve the width of div#sresult_container but i try to that increase the width of div#sresult_container 10px before it display on the view port. how can i do this plese help me?
my code is below:

var $sresult_container = $('<div id="sresult_container"></div>');

AND after that i append the some divs as children of div#sresult_container.

and append to body.

$('body').append($sresult_container);
var Setwidth  = $('#sresult_container').outerWidth() + 10;
$('#sresult_container').css('width',Setwidth + 'px');

so here first load original width after that load the modified width. so how can do directly load the modified width.

  • 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-10T05:27:33+00:00Added an answer on June 10, 2026 at 5:27 am

    First of all #sresult_container must have a pre-defined width.

    #sresult_container {
        width: 100px;    
    }
    
    $('<div id="sresult_container">text</div>').appendTo('body');
    
    $('#sresult_container').css('width', function () {
        return ($(this).outerWidth(true) + 10) + 'px';
    });​
    

    http://jsfiddle.net/xBZT7/14/

    http://jsfiddle.net/xBZT7/15/

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

Sidebar

Related Questions

I have one textbox#search_text. on keyup i create one div#sresult_container.and append to some div
I create one table by using jquery : <div class=productlist style=float:left; id=productlist> <script type=text/javascript
I have created a div there are two childs of that div one is
I'm trying to create slidingUp divs with variable 'top' heights, so that one div
I have to create an 'X' that pops up over the top right div
I'm trying to create ONE javascript function that can do the following: onclick, a
Hi every one i'm trying to create two divs. One div has a different
i have to create one asp.net mvc page that will show template of controls.
I have created one menu using div animating in the middle i have structured.
I want to create one new model class, which will be extended in all

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.