-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Preloader Events #3
Comments
How do you mean that exactly? |
`jQuery(document).ready(function ($) {
});` Tell me what you think about this. |
Yes, tested it and works fine. This is much more simpler and better. Want to create a pull request? |
There is an issue with |
`jQuery(document).ready(function ($) {
});` Hey, would this help? Can you tell me what you mean with download links? I tested it but it worked fine for me. The way I tested download links is:
Late-Night-Edit** Changed the var to let and added tel click function. |
What's about this? jQuery(document).ready(function ($) {
// Exclude links to fade-in
let ignore_onbeforeunload = false;
$('a[href^=mailto], a[href^=tel], a[data-fade="false"], .woocommerce-MyAccount-downloads-file').on('click', function () {
ignore_onbeforeunload = true;
});
// Preloader
$(window).bind('beforeunload', function () {
if (!ignore_onbeforeunload) {
$("#preloader").fadeIn('fast');
$('#status').fadeIn('fast');
}
ignore_onbeforeunload = false;
})
$(window).on('load', function () {
$('#status').fadeOut();
$('#preloader').delay(350).fadeOut('slow');
})
setTimeout(function () {
$('#status').fadeOut();
$('#preloader').delay(350).fadeOut('slow');
}, 1500);
}); We can add more links to exclude from fade-in if we found more. Users can manually set If you agree with that, I'm happy when you do a new pull request. |
Yes! :) |
@Kemal-Sulic Something else, did you received my mail about the fashion theme? |
Shouldn't the preloader generally be bound to the unload event instead of the click?
$(window).bind('beforeunload',function(){ }
I'm not an expert on what might cause problems with this, but it seems to work fine for my site.
The text was updated successfully, but these errors were encountered: