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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:34:19+00:00 2026-06-10T14:34:19+00:00

On a page i have two divs lets say Left_Div and Right_Div. On right

  • 0

On a page i have two divs lets say Left_Div and Right_Div. On right div i have multiple images positioned using Top and Left properties of CSS. Left_Div is used as a left panel and On a button click I animate Left_Div and Right_Div to slide right and Left_Div becomes visible. Just like left menu on facebook iphone app.

 $("#Right_Div").animate({ marginLeft: "600px" }, 500);    
 $("#LeftDiv").animate({ width: "600px", opacity: 1 }, 500);

The problem is that when Left_Div and Right_Div slide then images that are positioned by using Left and Right attributes do not move and as a result they overlap Left_Div. Anyone please help me how i can move images with DIVs.

I don’t want to rest top/left properties again because there are so many images and they are loaded dynamically.

I hope that i have explained my question 🙂

  • 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-10T14:34:19+00:00Added an answer on June 10, 2026 at 2:34 pm

    If you want dynamic movements you cannot give exact positions.

    By saying an image is a set amount of pixels from the left the image will always be exactly there, no matter what.

    You would have to use a floating logic whereby you assign for example float: left or float: right to all your components you want to line up beside each other on the left or right.

    Then when you are moving an element all other elements which are set to float beside it will move along with it.

    DEMO – floating example using your animation logic

    In the DEMO you can now see how elements move with each other when when floating is applied.

    The DEMO above has the following HTML:

    <div id="Left_Div">My left div</div>
    <div id="anotherLeftdiv">My other left div</div>
    <div id="anotherRightdiv">My other right div</div>
    <div id="Right_Div">my right div</div>​
    

    CSS:

    #Left_Div, #anotherLeftdiv{
        float: left;
    }
    
    #Right_Div, #anotherRightdiv{
     float: right;   
    }
    

    Script:

    $("#Left_Div").animate({ width: "150px", opacity: 1 }, 500);
    $("#anotherRightdiv").animate({ marginRight: "100px" }, 500);    
    

    I hope this makes sense. Without your exact current CSS and HTML it is hard to tell you exactly what it is you have to change.

    Edit
    I added 4 images to the right div and placed them into the 4 corners using float and clear instead of fixed positioning.

    They will simply move along with the animation of the div, as long a they do not get any fixed positions.

    DEMO – Animation with floating images

    The images are in a div container, by using float: left and clear: rightfor example you are telling the image to go all the way to the left and force a break to the right of it. Thus any other image using float: left will be forced to go in the row below.

    The same applies to the float:right and clear: right, those settings force the image to stay right and force a break to the right of it, forcing any other float: right to go into the line below.

    See the images in the HTML:

    <div id="Right_Div">
        <img class="left" src="http://www.fileden.com/files/2012/6/19/3318010/Eraser.png"/>
        <img class="right" src="http://www.fileden.com/files/2012/6/19/3318010/Script.png"/>
        <img class="left" src="http://www.fileden.com/files/2012/6/19/3318010/Ok.png"/>
        <img class="right" src="http://www.fileden.com/files/2012/6/19/3318010/Decrease%20time.png"/>
    </div>​
    

    The styles to force images into their corners:

    img.left{
        float: left;
        clear: right;
    }
    
    img.right{
        float: right;
        clear: right;
    }
    

    I hope this helps. You should have plenty to play around with now.

    If you come across any issue now with your specific implementation or any CSS you can’t work out, it would be easier to complete this question and ask a new one posting the specific code you are having issues with.

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

Sidebar

Related Questions

I have a page with the following two divs: <div id=searchResults> </div> <div class=postSearchOptions
I have a simple page layout with two divs--one on top, and one on
Suppose I have two DIVs on my page. <body> <div id=d1></div> <div id=d2></div> </body>
I have managed to put two divs side by side using a <div class=clear></div>
I have two divs in my page, div1 contains 3 droppable images (p1,p2,p3) and
In my html page i have two divs inside a container div. The two
I have two divs on my page, and between the two div's I have
I have two divs I'd like to position on top of each other using
In my page I have two divs called context and translation and in test1.php
On my web page I have two divs, A and B: The DOM looks

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.