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

Перевод документации на английский язык #1

Open
iserdmi opened this issue Mar 9, 2015 · 4 comments

Comments

@iserdmi
Copy link
Owner

iserdmi commented Mar 9, 2015

Хочу перевести документацию на английский язык. У меня проблемы с грамотностью, мне будет за такой перевод стыдно. Если вам понравился плагин, пожалуйста, помогите перевести «README.md». Возьмите любой кусок текста, переведите его и отправьте сюда в виде комментария. Спасибо!

Текущее состояние перевода можно посмотреть в этом файле: README_EN.md

@cavinsmith
Copy link

How to grab it?

Grab via bower:
$ bower install afterlag-js

Grab via npm:
$ npm install afterlag-js

Latest version CDN link (change 1.0.4 to older version if needed):

https://cdn.rawgit.com/iserdmi/afterlag-js/1.0.4/dist/afterlag.min.js
https://cdn.rawgit.com/iserdmi/afterlag-js/1.0.4/dist/jquery.afterlag.min.js

At the worst try direct download.

@cavinsmith
Copy link

Afterlag.js — plugin for tracking page load lags.

Ordinarily we are executing something just after page loads. However it is a period while page slows.
If you start animation at this point, before loading of some blocks on page, animation will twitch and spoil the impression.

Afterlag allows you to begin animation immediately when it can run smoothly and without lags. See demo.

Afterlag is built in native Javascript. jQuery plugin also exists. Plugin works out of the box and doesn't require additional configuration. However sophisticated soul will dig settings to configure Afterlag for itself.

@iserdmi
Copy link
Owner Author

iserdmi commented Mar 11, 2015

Спасибо большое, Андрей!

@vplameniraket
Copy link

Quick start


Choose a version of the plugin you are going to use – using native JS or using JQuery – and upload its file to your website.
<код>
When using JQuery version, there is no need in linking native plugin.
<код>

How does it work?


Along with the creation of a new object new Afterlag() there is an interval launched. This interval checks actual amount of time after its last call every 50 ms. If 50 ms are passed – as expected – lags are over, animation is going to run smoothly. To make sure about it, the match test is repeated 10 times. Every listed value may be edited in settings.

After successful 10th match test all the functions passed through afterlag.run() are called. If some function will have been passed to afterlag.run() after lags are over, this function will be called immediately.

Along with the call of $.afterlag() a new object is created automatically. If $.afterlag() was called previously, an older object will be used instead of the new one. The passed function will be called after lags are over.

Native plugin usage


<код>
Object contains Afterlag.js API in itself.
<код>
The passed function will be called immediately after lags are over. In the passed function (this) will contain Afterlag.js API. (info) variable is an object and contains information about (afterlag) object at the moment of calling the passed function:

-info.status
"success", if lags are actually over. "timeout", if lags are not over, but waiting time limit was exceeded.
-info.time_passed
Number of milliseconds passed since the moment of creation objects until lags are over.
-info.ready
If lags are over, returns true, otherwise false.
-info.options
Settings passed to an object when it is created.
<код>
object will be usable inside passed function as this.

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