add lightbox
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user