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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:40:57+00:00 2026-05-26T07:40:57+00:00

Basically I want my HTML structure to be restructured when window gets smaller than

  • 0

Basically I want my HTML structure to be restructured when window gets smaller than lets say 400px in width.

<div id="mainContainer">
    <div id="div1"> -- Loads of content here -- </div>
    <div id="div2"> -- Even more content here -- </div>
    <div id="div3"> -- You can't even imagine how much content here -- </div>
</div>

Now, after a user resizes his/hers browser below 400px in witdh I some how need to move div3 above div1, so the structure would look like this:

<div id="mainContainer">
    <div id="div3"> -- You can't even imagine how much content here -- </div>        
    <div id="div1"> -- Loads of content here -- </div>
    <div id="div2"> -- Even more content here -- </div>
</div>

I already have, by the use of jquery, a function to mesure the width of the window. But how do I accomplish the rest? I have looked a bit at this sort of similar question, which gave me an idea of how I might be able to, but it didn’t quiet help me out.

Any suggestions?

  • 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-26T07:40:58+00:00Added an answer on May 26, 2026 at 7:40 am

    http://jsfiddle.net/tMutA/1/

    You should maybe instead define a set of index parameters on different size and then run an sortby instead.

    var screenWidth = $(window).width();
    
    if(screenWidth < 600) {
        $('#div3').prependTo($('#mainContainer'));
    }
    
    $(window).resize(function() {
    var screenWidth = $(window).width();
    
    if(screenWidth < 600) {
        $('#div3').prependTo($('#mainContainer'));
    } else {
        $('#div2').prependTo($('#mainContainer'));
        $('#div1').prependTo($('#mainContainer'));
    }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML structure and want to convert it to an accordion. <div
I have the following HTML structure <div id=test-1-yay></div> ... bunch of code ... <div
I'm having trouble styling a select list in an html form. Basically I want
Can I attach any event handlers to HTML hidden input fields? Basically I want
I have the following DOM structure / HTML, I want to get (just practicing...)
I'm looking for re-ordering div position with php My html structure is something like
I have php generating html and I want to create layers. Basically I want
I basically want to use link_to to link to the index method of a
I basically want to do this: grep 'example.com' www_log > example.com.YYYY-MM-DD-H:i:S.log ...with of course
I basically want to do this in code: PersonList myPersonList; //populate myPersonList here, not

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.