4

I have made a HTML page with css animation and transitions

<div class="container-fluid" id="team">
<div class="row first">
    <div class="wrapper"></div>
</div>
<div class="row second">
    <div class="wrapper"></div>
    <div class="wrapper clickable">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.0.name}}</h2>
                <h5>{{team.0.position}}</h5>
                <p>{{team.0.description}}</p>
                <a href="">Learn more about {{team.0.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
    <div class="wrapper clickable right-side">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.6.name}}</h2>
                <h5>{{team.6.position}}</h5>
                <p>{{team.6.description}}</p>
                <a href="">Learn more about {{team.6.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
    <div class="wrapper"></div>
</div>
<div class="row third">
    <div class="wrapper clickable">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.3.name}}</h2>
                <h5>{{team.3.position}}</h5>
                <p>{{team.3.description}}</p>
                <a href="">Learn more about {{team.3.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
    <div class="wrapper clickable">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.2.name}}</h2>
                <h5>{{team.2.position}}</h5>
                <p>{{team.2.description}}</p>
                <a href="">Learn more about {{team.2.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
    <div class="wrapper clickable right-side">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.4.name}}</h2>
                <h5>{{team.4.position}}</h5>
                <p>{{team.4.description}}</p>
                <a href="">Learn more about {{team.4.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
</div>
<div class="row fourth">
    <div class="wrapper"></div>
    <div class="wrapper clickable">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.5.name}}</h2>
                <h5>{{team.5.position}}</h5>
                <p>{{team.5.description}}</p>
                <a href="">Learn more about {{team.5.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
    <div class="wrapper clickable right-side">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.1.name}}</h2>
                <h5>{{team.1.position}}</h5>
                <p>{{team.1.description}}</p>
                <a href="">Learn more about {{team.1.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
    <div class="wrapper"></div>
</div>
<div class="row fifth">
    <div class="wrapper"></div>
    <div class="wrapper join">
        <a href="">
            <span>+ Join</span>
        </a>
    </div>
    <div class="wrapper clickable right-side">
        <div class="shadow"></div>
        <div class="description">
            <div>
                <h2>{{team.7.name}}</h2>
                <h5>{{team.7.position}}</h5>
                <p>{{team.7.description}}</p>
                <a href="">Learn more about {{team.7.firstName}}</a>
            </div>
        </div>
        <img src="">
    </div>
</div>
<div class="row sixth">
    <div class="wrapper"></div>
    <div class="wrapper blank"></div>
    <div class="wrapper"></div>
</div>
<div class="row seventh">
    <div class="wrapper"></div>
    <div class="wrapper"></div>
</div>

Full working version is avaliable here: http://jsfiddle.net/xs4mm5jd/

As you can see it works fine and animations is fast and smooth.

However, when I added some images: http://jsfiddle.net/xs4mm5jd/1/ animation is glichy. Is there any solution to speed up the performance?

3
  • Hmmm. They both run wonderfully on chrome for mac. Commented Nov 27, 2014 at 14:30
  • Yeah it depends propably on computer speed. But after checking in Chrome inspector it rerenders all the content in each frame. Commented Nov 27, 2014 at 14:35
  • I have added version with heavier images so you can see the effect: jsfiddle.net/xs4mm5jd/4 Commented Nov 27, 2014 at 14:41

1 Answer 1

5

Even though I don't see bad performance in your fiddle, you can trigger hardware acceleration when animating.

Some people use a sort of hack applying either transform: translateZ(0); or transform: translate3d(0, 0, 0); to the animated elements.

Here you have a fiddle to test if you see any performance gain: http://jsfiddle.net/gleezer/xs4mm5jd/3/

Here's an article about it.

A second, newer (and probably better) alternative is to use the will-change property in your CSS, for example: will-change: transform;

Read more about it here.

Sign up to request clarification or add additional context in comments.

1 Comment

I have tried before with "will-change" property but it didn`t achive any results. But this translateZ worked perfectly. Thank you a lot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.