Design patterns that serve as basic building blocks.
Push
Push.js is the engine that connects Ratchet pages together with AJAX and the history api. Push.js is listening to all clicks on a page, so just make sure it’s included and link something in your project up.
This will use push to replace everything in the .content div with the .content of two.html. Also, it will either update or remove .bar-nav and .bar-tab according to their presences in two.html.
A working version of push:
Transitions
Now that pages are being loaded through push, it’s easy to specify transitions for animations between pages. There are three different transitions to chose from: fade, slide-in, or slide-out.
Fade transition
Slide transition
Push bind
push 작동 후 DOM 이 변경되므로 기존에 onload 타입이나 초기화를 해주는 기능들을 통해 인지되었던 외부 익스텐션을 기억못하는 현상. Push bind를 위해 addEventListner 는 push 작동후 callback 함수 개념으로 해당 함수를 한번더 초기화 하라는 의미
Push.js binds an event to the document that returns a detail object and can be used to fire a callback.