Hello, I am using the 'jquery-pjax ' library .
Faced a problem

  1. From the main page to the second one it goes normally, and to return to the main page, it already reloads the entire page.
  2. Both pages have a slider. BUT on the second page the slider does not work.

What is the problem?

Second page code

<!--HOME SLIDER--> <section class="section vh100"> <div class="homeSlider slider" id="homeSlider"> <!--SLIDE#1--> <div class="slideItem vh100" style="background-color: green"> <div class="headWrapper headWrapper__center"> <hgroup class="head-title"> <h1 class="head-title__title title big-title">PAGE 2</h1> </hgroup> </div> </div> <!--END SLIDE#1--> <!--SLIDE#2--> <div class="slideItem vh100" style="background-color: yellow"> <div class="headWrapper headWrapper__center"> <hgroup class="head-title"> <h1 class="head-title__title title big-title">PAGE 2</h1> </hgroup> </div> </div> <!--END SLIDE#2--> </div> </section> <!--END HOME SLIDER--> 

I tried to insert the whole page and connect the styles and js there, but then the ajax transition does not work at all

Js

  $(function(){ $(document).pjax('a', '#pjax-container') }); 

View an example of the site can be here.

  • imho better use some spa framework, since this library is not much developed (readme says that it is largely unmainteined ) - diraria

0