Skip to content

HashRouter

Thomas Handorf edited this page Oct 28, 2016 · 2 revisions

Hash Router

The HashRouter will handle all url's that contain a hash (#). This hash will contain the state that needs to be applied on the webpage.

Calling http://localhost/index.html#frame2 will transition to "frame2" in all layers that contain a frame "frame2". If you keep your frame names unique (which you should) only one transition would happen.

You can be more specific though: For example http://localhost/index.html#stage1.layer1.frame2 will make "layer1" in "stage1" transition to "frame2" if this frame in available.

<div data-lj-type="stage" data-lj-name="stage1">
    <div data-lj-type="layer" data-lj-name="layer1" data-lj-default-frame="frame1" >
        <div data-lj-type="frame" data-lj-name="frame1">
            … your HTML code …            
        </div>    
        <div data-lj-type="frame" data-lj-name="frame2">
            … your HTML code …            
        </div>        
    </div>
</div>

If you want to pass in multiple state paths, this is possible by delimiting them with a ; character. For example http://localhost/index.html#stage1.layer1.frame2;stage1.layer2.frame2.

Calling http://localhost/index.html#layer1.frame2 will make all layers called "layer1" transition to "frame2" if that frame is available.

Clone this wiki locally