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

Request: onComplete callback #26

Open
justinmetros opened this issue Dec 11, 2014 · 2 comments
Open

Request: onComplete callback #26

justinmetros opened this issue Dec 11, 2014 · 2 comments

Comments

@justinmetros
Copy link

Cool plugin, thanks!

Just a thought, might be nice to have some sort of onComplete() callback once the plugin initializes and does its thing.

With multiple headers, its possible to see a flash of the default element before the appropriately styled element kicks in.

With a callback to signify midnight.js completed its task, it would be a cinch to remove any classes added to initially hide the undesired elements. Will fork if I can find some time. Thanks again!

@RobertoGonzalez
Copy link
Member

@justinmetros If you want to do a fork, you should check out the 1.1 branch. The plugin is being refactored to support public methods (as well as cleaning up the code a bit). Callbacks are coming, so a PR would be quite welcome there (mostly to notify users when a header changes).

The main workaround for that issue is to add visibility:hidden to the header (via CSS -don't use display:none, since it'll break the plugin-) and remove it just after the $('header').midnight() call. That way the header won't flash on startup under most scenarios.

Thanks!

@justinmetros
Copy link
Author

Great, thanks for quick reply!

Will try to get that PR in off 1.1.

In the meantime the workaround you mention is the exact solution I put in place and it gets the job done.

@Aerolab Aerolab deleted a comment from jordan26 Oct 21, 2018
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

2 participants