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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:24:21+00:00 2026-06-14T19:24:21+00:00

I have a stack of ‘pages’ that I’m trying to move on mousewheel, such

  • 0

I have a stack of ‘pages’ that I’m trying to move on mousewheel, such that the top one moves more than the one underneath it, etc. They’re position: absolute, and currently I’m adjusting the CSS top to move them around, but it is veeery slow and janky.

EDIT: took down demo, problem solved.

Relevant code:

window.onScroll = (e, delta) ->
    e.preventDefault()

    minHeight = 5
    maxHeight = 800
    top_scale = 50
    second_scale = 5
    third_scale = 1
    stack = $('.card_stack').first().children()
    top = $(stack[stack.length - 1])
    second = $(stack[stack.length - 2])
    third = $(stack[stack.length - 3])

    for pair in [[top, top_scale], [second, second_scale], [third, third_scale]]
        pair[0].css('top', parseInt(pair[0].css('top'), 10) + delta*pair[1] + 'px')

$(window).mousewheel(window.onScroll)   # jQuery mousewheel plugin  

I tried looking at this in the Frames tab of Chrome to figure out what’s so slow, and got this: https://dl.dropbox.com/u/407870/static/Screen%20Shot%202012-11-20%20at%201.44.33%20PM.png

It looks like there’s not really much going on, but maybe I’m missing something. A previous, unanswered question related to the Frames problem I’m having: Web inspector profiling with "Frames": finding the cause of performance problems when nothing appears in the timeline

I know there are a bunch of other things that should be cleaned up before any kind of release (eg, I’m compiling Less and Coffeescript in-page) but the scrolling is my current concern, as it is central to my premise.

How can I best speed this up?

  • 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-14T19:24:23+00:00Added an answer on June 14, 2026 at 7:24 pm

    Ok I think I identified the problem (my dear Watson). It doesn’t comes from the scroll event but more on what you do with it.
    If you check the frames you have a painting that takes 70ms. That’s because you use heavy css3 rules like box-shadows. If you remove it you will have only 7ms of painting ! (so 10x performance).

    As a general rule try to avoid using css3 properties on animated elements (cause they are heavy to render for the browser !).

    You can have a look at this Google I/O 2012 conference about this particular problem and how to solve it : https://www.youtube.com/watch?v=hAzhayTnhEI

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

Sidebar

Related Questions

I have view stack in a app like so: <mx:ViewStack id=viewStack left=0 right=0 top=0
I'm outside gdb's target executable and I don't even have a stack that corresponds
I have stack category for NSMutableArray that I use in Class A @implementation NSMutableArray
I have a Stack object being worked on by multiple threads. One of the
I have a stack A and I want to create a stack B that
I have stack of activities launched after one another. but in one of the
Let's say that I have this stack of activities: A -> B -> C
I have a stack of divs that belong to a specific class, say tabs.
I have a stack trace that looks like this: #3 0x00007fffde86c206 in GetMedia (p_ml=0xb91560,
I have a stack of cards. They are stacked so each one has about

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.