A
A
Alexander2017-05-13 10:53:17
Yii
Alexander, 2017-05-13 10:53:17

How to delay insertion of new content in pjax yii2?

I use animation when moving from one page to another using pjax. The animation takes 250 ms and sometimes doesn't fit until new content appears if you send a pjax request immediately after pressing the button. The option of sending a request with a delay is not suitable, because in this case heavy pages are loaded too long. That is, it is necessary that the pjax request is sent instantly, but the insertion of new content occurs at least 250 ms after the request is sent.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-13
@webinar

The Pjax widget for yii2 has a bunch of settings, including ReplaceState . So you cancel the content replacement and write your own logic in js by delay or something else, while clinging to plugin events , for example pjax:complete or pjax:start and pjax:end.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question