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

Avoid duplicated $.offset() call #50

Closed
gagarine opened this issue May 16, 2013 · 5 comments
Closed

Avoid duplicated $.offset() call #50

gagarine opened this issue May 16, 2013 · 5 comments
Assignees

Comments

@gagarine
Copy link
Contributor

In the same idea than #48 we can avoid calling offset multiple time.

The Firefox's profiler show me this is where the script use most of the time. For my usage I even create my own offset function than is faster than the jQuery once. I can avoid some test than jQuery need like testing if we are in a iframe or not...

I will be happy to make a pull request but want to know what do you prefer:

  • jute avoid unnecessary $.offset() call (their is 4 call by animated object and I can reduce that to one call)
  • replace the $.offset() with an alternative function a bit (~20%) faster.

You can see my version performing on http://face-it.ch/fr/mission/congo (it still a work in progress and script are uncompressed at least for the moment).

@janpaepke
Copy link
Collaborator

Hi Gagarine,

I saw that John already accepted your pull request. So the update is already in the code...
Thank you for contributing.

regards,
Jan

@gagarine
Copy link
Contributor Author

Nop it's not the same pull request :).

@gagarine
Copy link
Contributor Author

As a reference point. On page http://johnpolacek.github.io/superscrollorama/

screen shot 2013-05-16 at 2 27 35 pm

@janpaepke
Copy link
Collaborator

Hi Simon,

sorry for the misunderstanding.

Okay in general I think it's preferable to avoid unnecessary calls instead of replacing the offset function.
But this is a very delicate subject and sometimes a call is needed for the right values.
Please make your changes and send a pull request.

I will then go over your changes and make sure there will be no unexpected behaviour for other users.

thank you and regards,
Jan

@gagarine
Copy link
Contributor Author

gagarine commented Jul 8, 2013

ok this was closed with the pull request #53

@gagarine gagarine closed this as completed Jul 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants