j-Layout2
- This component is a much simple component compared to
j-Layout.
Configuration:
parent{String} can containparent,windowor jQuery selector for theclosestmethod (default:window)margin{Number} adds margin for theheight(default:0)autoresize{Boolean} enables auto-resize (default:true)
Methods:
- IMPORTANT
component.show(type)can show a specific panel for mobile devices,typecan beleft,rightormain component.resizescrollbar(panel_type)resizes a scrollbar for a specific panelcomponent.scrolltop(panel_type)scrolls to top for a specific panel
Panel types:
leftleft panelrightright paneltoptop panel (it's panel on top of all panels)top2top panel and usestopkey in the config (it is betweenleftandrightpanel)bottombottom panel (it's panel on bottom of all panels)bottom2bottom panel and usesbottomkey in the config (it is betweenleftandrightpanel)mainmain content
Layout:
Making of layout is very easy.
<div data-type="" data-size="" data-scrollbar=""></div>Attributes:
data-typemust contain a type of sectiontop,top2,left,right,bottom,bottom2ormaindata-sizecontains a size of sectionLG,MD,SM,XS--> in pixels or percentage, example:200,200,200,0(0means hidden) or20%(all values will inherit20%)data-scrollbar="margin:50;visible:1"enables scrollbar, possible values:selector{String} optional, jQuery selector for scrollbar containermargin{Number} scrollbar margin (default:0)visible{Boolean} shows the scrollbar
Good to know:
- each panel is
sectionelement and must containdata-type="top"attribute with type of panel - define panels only which you will use
- ordering of all
sectionelements isn't important
Use it with <ui-component name="layout2">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<ui-component name="layout2" config="parent:window" class="invisible">
<div data-type="top" data-size="44" style="background-color:red">
TOP
</div>
<div data-type="bottom2" data-size="44" style="background-color:blue">
BOTTOM
</div>
<div data-type="left" data-size="20%,20%,20%,0" style="background-color:green">
LEFT
</div>
<div data-type="right" data-size="20%,20%,20%,0" style="background-color:purple">
RIGHT
</div>
<div data-type="main" data-scrollbar="visible:true" style="background-color:#F0F0F0">
</div>
</ui-component>