add lightbox

This commit is contained in:
kevin
2021-02-18 21:45:17 +01:00
parent 36898dadc9
commit ad2e87902f
22 changed files with 1350 additions and 20 deletions
+64 -1
View File
@@ -393,7 +393,68 @@ function scrollReaveal(){
ScrollReveal().reveal(nodes.node_moment, showUp);
}
$( document ).ready(function() {
function pagination(){
const $next = $('#block-views-block-gallerie-block-1 .pager a');
$next.on("click",function(event){
event.preventDefault();
const $url = $(this).attr('href');
var PageMax = $(this).attr('data-totalpages');
var split = $url.split('=');
var base_uri = split[0];
var currentPage = split[1];
currentPage++;
ajaxPage(base_uri, currentPage, $url);
if (currentPage > PageMax) {
$(this).remove();
}
});
function ajaxPage(base_uri, currentPage, $url) {
$('.loader').addClass('show');
$.ajax({
method: "GET",
url: $url,
async: true,
cache: false,
dataType: "html",
statusCode: {
//traitement en cas de succès
200: function() {
$('.loader').removeClass('show');
},
}
})
.done(function( data ) {
let $data = $(data).find(".wrap--image");
$( "#block-views-block-gallerie-block-1 section.d-flex" ).append($data);
$next.attr('href', base_uri +'='+ currentPage);
});
}
}
function Light(){
lightbox.option({
'resizeDuration': 200,
'wrapAround': true,
'alwaysShowNavOnTouchDevices':true,
'positionFromTop': 50,
'disableScrolling':true
})
}
$( document ).ready(function() {
// currenturl();
scrollReaveal();
notes();
@@ -403,6 +464,8 @@ function scrollReaveal(){
select_custom();
remove_isactive();
hidden_morelinkMoment();
pagination();
Light();
});
})(jQuery);