mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
This commit is contained in:
parent
26637d266d
commit
53091914bd
2 changed files with 35 additions and 34 deletions
|
@ -1,7 +1,7 @@
|
||||||
var video;
|
var video;
|
||||||
var cat;
|
var cat;
|
||||||
var videos_id;
|
var videos_id;
|
||||||
var $carousel;
|
var $carousel = [];
|
||||||
|
|
||||||
function isFlickityEnabled(selector) {
|
function isFlickityEnabled(selector) {
|
||||||
var isEnabled = $(selector).hasClass('flickity-enabled');
|
var isEnabled = $(selector).hasClass('flickity-enabled');
|
||||||
|
@ -10,7 +10,9 @@ function isFlickityEnabled(selector) {
|
||||||
$('#footerDiv').fadeIn();
|
$('#footerDiv').fadeIn();
|
||||||
|
|
||||||
$('.container-fluid').fadeIn('slow', function () {
|
$('.container-fluid').fadeIn('slow', function () {
|
||||||
$carousel.flickity('resize');
|
for (i = 0; i < $carousel.length; i++) {
|
||||||
|
$carousel[i].flickity('resize');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
@ -18,7 +20,6 @@ function isFlickityEnabled(selector) {
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(function () {
|
$(function () {
|
||||||
startModeFlix("");
|
startModeFlix("");
|
||||||
|
|
||||||
|
@ -26,31 +27,33 @@ $(function () {
|
||||||
$('#loading').fadeOut();
|
$('#loading').fadeOut();
|
||||||
$('#footerDiv').fadeIn();
|
$('#footerDiv').fadeIn();
|
||||||
$('.container-fluid').fadeIn('slow', function () {
|
$('.container-fluid').fadeIn('slow', function () {
|
||||||
$carousel.flickity('resize');
|
for (i = 0; i < $carousel.length; i++) {
|
||||||
|
$carousel[i].flickity('resize');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
isFlickityEnabled('.carousel');
|
isFlickityEnabled('.carousel');
|
||||||
});
|
});
|
||||||
|
|
||||||
function startModeFlix(container){
|
function startModeFlix(container) {
|
||||||
|
|
||||||
if($(container+".thumbsImage").attr('startModeFlix') == 1){
|
if ($(container + ".thumbsImage").attr('startModeFlix') == 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(container+".thumbsImage").on("mouseenter", function () {
|
$(container + ".thumbsImage").on("mouseenter", function () {
|
||||||
//$(this).find(".thumbsGIF").height($(this).find(".thumbsJPG").height());
|
//$(this).find(".thumbsGIF").height($(this).find(".thumbsJPG").height());
|
||||||
//$(this).find(".thumbsGIF").width($(this).find(".thumbsJPG").width());
|
//$(this).find(".thumbsGIF").width($(this).find(".thumbsJPG").width());
|
||||||
$(this).find(".thumbsGIF").stop(true, true).fadeIn();
|
$(this).find(".thumbsGIF").stop(true, true).fadeIn();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(container+".thumbsImage").on("mouseleave", function () {
|
$(container + ".thumbsImage").on("mouseleave", function () {
|
||||||
$(this).find(".thumbsGIF").stop(true, true).fadeOut();
|
$(this).find(".thumbsGIF").stop(true, true).fadeOut();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$(container+".thumbsImage").on("click", function () {
|
$(container + ".thumbsImage").on("click", function () {
|
||||||
var crc = $(this).attr('crc');
|
var crc = $(this).attr('crc');
|
||||||
var myEleTop = $('.navbar-fixed-top .items-container').outerHeight(true);
|
var myEleTop = $('.navbar-fixed-top .items-container').outerHeight(true);
|
||||||
var row = $(this).closest('.row');
|
var row = $(this).closest('.row');
|
||||||
|
@ -59,24 +62,28 @@ function startModeFlix(container){
|
||||||
|
|
||||||
$(".arrow-down").fadeOut();
|
$(".arrow-down").fadeOut();
|
||||||
$(".thumbsImage").removeClass('active');
|
$(".thumbsImage").removeClass('active');
|
||||||
$('.poster').not('#poster'+crc).slideUp();
|
$('.poster').not('#poster' + crc).slideUp();
|
||||||
if($('#poster'+crc).is(":hidden")){
|
if ($('#poster' + crc).is(":hidden")) {
|
||||||
$('#poster'+crc).css('background-image', 'url(' + $('#poster'+crc).attr('poster') + ')');
|
$('#poster' + crc).css('background-image', 'url(' + $('#poster' + crc).attr('poster') + ')');
|
||||||
$('#poster'+crc).slideDown('slow', function () {
|
$('#poster' + crc).slideDown('slow', function () {
|
||||||
var top = row.offset().top;
|
var top = row.offset().top;
|
||||||
$('html, body').animate({
|
$('html, body').animate({
|
||||||
scrollTop: top - myEleTop
|
scrollTop: top - myEleTop
|
||||||
}, 'slow');
|
}, 'slow');
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
$('#poster'+crc).slideUp();
|
$('#poster' + crc).slideUp();
|
||||||
$carousel.flickity('playPlayer');
|
for (i = 0; i < $carousel.length; i++) {
|
||||||
|
$carousel[i].flickity('playPlayer');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(container + '.carousel').each(function (index) {
|
||||||
|
var json = JSON.parse($(this).attr('data-flickity'));
|
||||||
|
$carousel.push($(this).flickity(json));
|
||||||
|
});
|
||||||
|
|
||||||
$carousel = $(container+'.carousel').flickity();
|
$(container + ".thumbsImage").attr('startModeFlix', 1);
|
||||||
|
|
||||||
$(container+".thumbsImage").attr('startModeFlix', 1);
|
|
||||||
}
|
}
|
|
@ -246,12 +246,6 @@ TimeLogStart($timeLog);
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
setTimeout(function () {
|
|
||||||
$("img.thumbsJPG").each(function (index) {
|
|
||||||
$(this).attr('src', $(this).attr('data-flickity-lazyload'));
|
|
||||||
$(this).addClass('flickity-lazyloaded');
|
|
||||||
});
|
|
||||||
}, 500);
|
|
||||||
$container = $('#categoriesContainer').infiniteScroll({
|
$container = $('#categoriesContainer').infiniteScroll({
|
||||||
path: '.pagination__next',
|
path: '.pagination__next',
|
||||||
append: '.categoriesContainerItem',
|
append: '.categoriesContainerItem',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue