0

i have some lag coming from opening up the menu. I have listed my site so you can view it:

http://www.Skarchmit.tumblr.com

As a side note: links to external scripts and css do not do anything - they are directly in the code with and similar tags. Some images have not yet been uploaded yet. And appear as question marks.

My current way of making the menu :

Content: 100%, menu: 0px; Click on it Content left -250px, menu : 250px

Everything is float.

Im not sure if thats the best way, but its seems laggy on mobile devices especially.

How would i best optimize it for speed?

<http://jsfiddle.net/skarchmit/LbgQJ/2/>
3
  • 6
    Add code please. also, try to paste your menu at jsfiddle (or similar) and test it there. Commented Aug 1, 2014 at 22:09
  • It does feel Laggy on iPad, but you have to post some code for us to determine the reason of that. Commented Aug 1, 2014 at 22:15
  • we really need to see some code to say anything useful. In the mean while, read this excellent post on animation performance: html5rocks.com/en/tutorials/speed/high-performance-animations Commented Aug 1, 2014 at 22:20

1 Answer 1

1

As others have said, it's performing fine on my personal mobile device. However, you can try using the transform css property to compare (it has performed better for me in history, especially with hardware acceleration).

Example:

.content {
  transform: translate3d(0, 0, 0);  
}
.content.open {
  transform: translate3d(-250px, 0, 0);  
}
Sign up to request clarification or add additional context in comments.

2 Comments

just as an addition, you would need to write a transition rule like transition: transform 0.5s. And by assuming 3d transforms, you're missing any ie9 users. In that case you could just fall back to 2d, but in any case, still more performant than animating left` prop.
I haven't use it yet. Trying to figure it out :/

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.