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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:47:49+00:00 2026-06-15T15:47:49+00:00

I have a 10000px DIV. Within this DIV I have various 500px DIV’s as

  • 0

I have a 10000px DIV. Within this DIV I have various 500px DIV’s as below:

<div class="huge-div">
   <div class="some-div">
   <div class="some-div">
   <div class="new-div">
   <div class="new-div">
   <div class="new-div">
</div>

I need to find the first DIV with the class “new-div” and reposition the “huge-div” so it shows the first “new-div” to the left of the browser/view.

So far, I can find the first DIV, add it a new class (to change its color) but not sure how to tell it to line-up the “huge-div” to the left, based on the “new-div” first appearance.

$('.new-div').first().addClass('great').---line-up "huge-div" to the left---();

//

  • 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-15T15:47:51+00:00Added an answer on June 15, 2026 at 3:47 pm

    Like this?
    http://jsfiddle.net/8WYpW/1/

    Add a wrapper:

    <div class="huge-div">
        <div class="wrapper">
           <div class="some-div">test</div>
           <div class="some-div">test</div>
           <div class="some-div great">great</div>
           <div class="some-div">test</div>
           <div class="some-div">test</div>
        </div>
    </div>
    

    Then position based on a negative margin:

    $(function() {
        setTimeout(function() {        
            $('.huge-div').animate({marginLeft: -$('.great').offset().left});
        }, 1000);
    });
    

    Edit

    To directly go there use css instead of animate:

    $('.huge-div').css({marginLeft: -$('.great').offset().left});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large DIV of 586px width. Within this are two smaller DIVs,
I need some help. I have a div wrapper and some other div's inside
I have some html with the basic structure <nav> <div> <a href=> <div class=navlink
Lets say I have this <div class=sectionContainer> <div class=itemsContainer> <div class=items></div> <div class=items></div> <div
have written this little class, which generates a UUID every time an object of
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
This shouldn't be hard...I have a menu and some content wrapped in a centered,
I have 3 divs within a wrapper: <div id=wrapper> <div id=leftbar> Lorem ipsum dolar
I have the following html page: <body> <div class=hide1 style=width:1000px; height:1000px;> <table width=100% border=0
I have a container DIV with a fixed height and width (275x1000px). In this

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.