1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

show the screen after 2 seconds max

This commit is contained in:
daniel 2018-12-15 17:16:14 -03:00
parent ac26179b0c
commit 79cba62d66

View file

@ -3,16 +3,16 @@ var cat;
var videos_id;
var $carousel;
function isFlickityEnabled(selector) {
function isFlickityEnabled(selector, tryAttempt) {
var isEnabled = $(selector).hasClass('flickity-enabled');
if (isEnabled) {
if (isEnabled || tryAttempt>4) {
$('#loading').fadeOut();
$('.container-fluid').fadeIn('slow', function () {
$carousel.flickity('resize');
});
} else {
setTimeout(function () {
isFlickityEnabled(selector)
isFlickityEnabled(selector,++tryAttempt);
}, 500);
}
}
@ -51,7 +51,7 @@ $(function () {
});
$carousel = $('.carousel').flickity();
isFlickityEnabled('.carousel');
isFlickityEnabled('.carousel', 0);
});