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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:28:52+00:00 2026-05-26T04:28:52+00:00

I am developing an HTML5 web application for mobile devices and ran into a

  • 0

I am developing an HTML5 web application for mobile devices and ran into a bit of trouble with smooth animations.

Essentially, when a user taps a button, a drawer (a div with height: 0px) should animate to a given height (in pixels) and content will be appended to that drawer. If you have a Pinterest account, you can see the animation as it is now, at http://m.pinterest.com (tap the Comment or Repin button).

The unfortunate problem is that on mobile devices, Webkit Transitions aren’t hardware-accelerated the height property, so its extremely laggy and the animation is jagged.

Here are some code snippets:

  1. HTML:
    …

    <div class="pin">
        <a class="comment_btn mbtn" href="#" title="" ontouchstart="">Comment</a>
        <div class="comment_wrapper">
            <div class="divider bottom_shadow"></div>
            <div class="comment">
                <!-- Content appended here -->
            </div>
            <div class="divider top_shadow" style="margin-top: 0"></div>
        </div>
    </div>
    
    <div class="pin"> ... </div>
    
  2. CSS:

    .comment_wrapper {
        -webkit-transition: all 0.4s ease-in-out, height 0.4s ease-in-out;
        position: relative;
        overflow: hidden;
        width: 100%;
        float: left;
        height: 0;
    }
    
    
    .comment {
        background: #f4eeee;
        margin-left: -10px;
        padding: 10px;
        height: 100%;
        width: 100%;
        float: left;
    }
    
  3. Javascript (using jQuery):

    function showSheet(button, wrapper, height) {       
        // Animate the wrapper in.
        var css = wrapper.css({
            'height': height + 'px', 
            'overflow': 'visible',
            'margin-bottom': '20px',
            'margin-top': '10px'
        });
    
        button.addClass('pressed');
    }
    
    $('.comment_btn').click(function() {
        showSheet($(this), $(this).siblings('.comment_wrapper'), 150);
    });
    
  4. Screenshots : https://i.stack.imgur.com/WnGpU.png

Screenshot of the question

Here are the problems I encountered with Webkit Transforms that I can’t quite figure out:

  1. Webkit Transforms scale the children of the container, which is undesirable for what I’m trying to do. -webkit-transform: none applied to the children don’t seem to reset this behavior.
  2. Webkit Transforms don’t move sibling elements. So, the .pin container after the one we’re operating on doesn’t move down automatically. This can be fixed manually, but it is a hassle.

Thanks a lot!

  • 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-26T04:28:53+00:00Added an answer on May 26, 2026 at 4:28 am

    With mobile phones being so fast it’s easy to forget they are actually pretty humble devices when you compare them to desktop hardware. The reason why your page is slow it because of rendering reflows:

    http://code.google.com/speed/articles/reflow.html

    When the div grows, it has to push and recalculate the positions of all the elements, which is expensive to a mobile device.

    I know it’s a compromise, but the only way you can make the animation smoother is by putting position: absolute on .comment_wrapper; or if you really want butter smooth animation, make it pop up from under the screen with css transforms, i.e.

    .comment_wrapper {
      height: 200px;
      position: absolute;
      width: 100%;
      bottom: 0;
      -webkit-transform: translate(0, 100%);
    }
    
    
    var css = wrapper.css({
        '-webkit-transform': 'translate(0, 100%)'
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently developing a web application and have run into a little problem. I'm
I am developing a web application using django, postgreSQL, html5 and javascript. The application
I need your advice guys. I am developing a web browser application for mobile
I am developing a web application where the user has to upload the pics.Is
We are developing web browser application for mobile phones and I am trying to
So I have been developing a web application, and I have implemented the HTML5
I am developing an ASP.NET web application at work, and I keep running into
I am developing a web application that is going to be both IE9/HTML5 compatible
I am developing a web application that allows a user to add entries to
When developing a new web based application which version of html should you aim

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.