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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:05:26+00:00 2026-06-18T11:05:26+00:00

I have a bunch of divs in sort of a grid pattern, and when

  • 0

I have a bunch of divs in sort of a grid pattern, and when a tile div is clicked on, i want it to expand out to the right to show a previously hidden div. however, during the animation, the surrounding tile divs are put out of position for a moment before going back to their correct position after the animation completes. I would like it to just smoothly slide out to the right. click on the top left tile to see most closely what I mean.

Here’s the JS code, but I assume there has to be some CSS tweak. see the fiddle for CSS.

$('.tile').on('click', function(){
    $(this).find('.sparkline').show();

    $(this).animate({
        width : '326px'
    },
    600, 
    function(){

    }); 
});

JSFiddle

All the Less:

.tiles{
  .tile{
    display:inline-block;
    width:auto;
    height:72px;
    margin:8px;
    background-color:#F1F1F1;
    border:1px solid gray;
    border-radius:5px;
    cursor:pointer;
    .origMetrics{
      width:154px;
      display:inline-block;
    }
    .sparkline{
      display:inline-block;
      width:154px;
      height:53px;
      float:right;
    }
    .seperator {
      margin: 0 15px 5px 15px;
      border-color:black;
    }
    .metrictitle{
      display:block;
      margin-left:auto;
      margin-right:auto;
      text-align:center;
    }
    .metricvalue {
      display:inline-block;
      text-align:left;
      width:auto;
      margin-left:10px;
      font-size:25px;
    }
    .metrictrend {
      float:right;
      margin-right:10px;
      margin-top:5px;
    }
    .positive{
      color:green;
      img{
        position:relative;
        bottom:15px;
        left:15px;
      }
    }
    .negative{
      color:red;
      img{
        display:none;
      }
    }
    .even{
      img{
        display:none;
      }
    }
  }
}
  • 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-18T11:05:27+00:00Added an answer on June 18, 2026 at 11:05 am

    Try placing the showing of the sparkline div inside of the .animate() complete callback function.

    The sparkline container was being shown and taking up space in the DOM prior to the animation being completed. This led to the appearance of a jump in the animation.

    For an even cleaner look, you can use .fadeIn() instead of .show() on the sparkline container.

    $('.tile').on('click', function () {
        $(this).animate({
            width: '326px'
        }, 600, function () {
            $(this).find('.sparkline').fadeIn();
        });
    });
    

    In addition, in IE and Firefox it appears that the display: inline-block style on the tiles was interfering with the overflow: hidden that gets applied as part of the animation. When you utilize inline-block, I would highly suggest also setting the vertical-align property accordingly. In your case, I believe vertical-align: top would be the best setting for the tiles.

    .tile{
        display:inline-block;
        vertical-align: top;
        width:auto;
        height:72px;
        margin:8px;
        background-color:#F1F1F1;
        border:1px solid gray;
        border-radius:5px;
        cursor:pointer;
    }
    

    jsfiddle

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

Sidebar

Related Questions

I have an application creating a bunch of divs through a loop. Each div
I want to toggle a bunch of divs that each have the same id.
I have a bunch of divs like this: <div class=bear></div> <div class=dog></div> How do
I have a bunch of divs with content inside of them, and I want
I have a parent div, and it houses a bunch of child divs. One
I have a parent div called main. It has a bunch of child divs
i have 2 overlapping divs like so: div.back { background:url(brick.png); background-attachment:fixed; background-position:right top; background-repeat:no-repeat;
I have a div .project-container which contains a bunch of divs with set heights
I have a bunch of divs that are all hidden like this <div class=elements>
I have a bunch of divs which I nest arbitrarily: <div> <div> <div>Apple</div> <div>

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.