Help please solve the problem: I use the pjax plugin to move between the navigation pages.

Everything works, but there is a problem - you need to make a delay before moving to another page, because There are no loading gifs visible, and you need to do a certain animation before such a transition

Main.js code:

$(function() { // jQuery PJAX $(document).pjax('.navbar-brand, .description, .placement, .around, .genplan, .ipoteque, .gallery, .documents, .contacts', '#content', { fragment: '#content' }); $.pjax.defaults.timeout = 2500; // .pjax - класс мСню Π½Π°Π²ΠΈΠ³Π°Ρ†ΠΈΠΈ $('.pjax').bind('click', function() { $.ajax({ beforeSend: function() { $('#content').on('pjax:beforeSend', function() { // LOADING $(".loading").addClass("show"); }); $('#content').on('pjax:success', function() { // END OF LOADING $(".loading").removeClass("show"); }); // ΠŸΡ€ΠΎΠ±ΡƒΡŽ Π·Π°ΠΏΠΈΠ»ΠΈΡ‚ΡŒ Π°Π½ΠΈΠΌΠ°Ρ†ΠΈΡŽ ΠΏΠ΅Ρ€Π΅Π΄ ΠΏΠ΅Ρ€Π΅Ρ…ΠΎΠ΄ΠΎΠΌ pjax var anim = $('.center-block img').animate({ 'margin-left': '1000px' }, 1000); } }) }) // Active links after click $('.navbar-nav li').bind('click', function() { $('.navbar-nav li').removeClass('active'); $(this).addClass('active'); }) $('a.navbar-brand').bind('click', function() { $('.navbar-nav li').removeClass('active'); }) }) 

I already tried all sorts of ways: first I changed the timeout option of the plugin, then I tried to make an ajax request before clicking on the menu link, and put a delay in php using sleep() , but to nothing.

Example: http://www.lisles.ru/

In general, as a novice, I will be very grateful for the help!

    0