Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow rendering & poor performance? #53

Open
jonthomason123 opened this issue Jan 19, 2015 · 3 comments
Open

Slow rendering & poor performance? #53

jonthomason123 opened this issue Jan 19, 2015 · 3 comments

Comments

@jonthomason123
Copy link

Hi, I am including about 15 style sheets with 2 or 3 sections on each file and I am experiencing poor performance when I scroll up and down.

Has anyone had this happen to them and is there a fix? I would really like to continue using Kalei.

Thanks

@adispezio
Copy link

I haven't tested this, nor do I have a PR to help - but I'd look into the scroll event in page.js
https://github.com/thomasdavis/kaleistyleguide/blob/gh-pages/js/views/style/page.js#L138

It looks like the logic must re-traverse the dom every time the page is scrolled to find out if the submenu item is currently on screen - and then apply the active class. I'd start by removing this to see if it clears up the fps.

If that helps, then I'd find a way to cache the submenu items in an array or append some attribute to each so that they can be identified more easily than having to use an expensive query selector each time.

@jonthomason123
Copy link
Author

That totally worked and fixed the performance problems!

I can't thank you enough.

@avrorov
Copy link

avrorov commented Jan 21, 2015

Thank you adispezio! That worked great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants