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:
parent
ac26179b0c
commit
79cba62d66
1 changed files with 4 additions and 4 deletions
|
@ -3,16 +3,16 @@ var cat;
|
||||||
var videos_id;
|
var videos_id;
|
||||||
var $carousel;
|
var $carousel;
|
||||||
|
|
||||||
function isFlickityEnabled(selector) {
|
function isFlickityEnabled(selector, tryAttempt) {
|
||||||
var isEnabled = $(selector).hasClass('flickity-enabled');
|
var isEnabled = $(selector).hasClass('flickity-enabled');
|
||||||
if (isEnabled) {
|
if (isEnabled || tryAttempt>4) {
|
||||||
$('#loading').fadeOut();
|
$('#loading').fadeOut();
|
||||||
$('.container-fluid').fadeIn('slow', function () {
|
$('.container-fluid').fadeIn('slow', function () {
|
||||||
$carousel.flickity('resize');
|
$carousel.flickity('resize');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
isFlickityEnabled(selector)
|
isFlickityEnabled(selector,++tryAttempt);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ $(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
$carousel = $('.carousel').flickity();
|
$carousel = $('.carousel').flickity();
|
||||||
isFlickityEnabled('.carousel');
|
isFlickityEnabled('.carousel', 0);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue