How to set default state of a component?

49 views
Skip to first unread message

ensnmz

unread,
Dec 31, 2011, 10:08:56 AM12/31/11
to jLayout
Hello there,

I have three components, which are WEST, NORTH and CENTER for the site
content.

What I want is a functionality for my already logged users, to give
them ability to set a default state for WEST component. So users that
don't want to see a component on the left will close it. At this part,
I need to modify my javascript code (that creates the layout) to help
the plugin show the west panel or not, during the page loading.

How to set WEST components visibility? This is the code of my layout
design:

var container = $('#container');
function doLayout() { container.layout({resize: false}); }
doLayout();
$(window).resize(doLayout);

HTML:

<div class="north">HERE IS NORTH</div>
<div class="west">HERE IS WEST</div>
<div class="center">HERE IS CENTER</div>

Bram Stein

unread,
Jan 4, 2012, 10:52:51 AM1/4/12
to jLayout
Hello,

You can have a look at the toggle-able border layout example:

http://www.bramstein.com/projects/jlayout/borderlayout-toggle.html

You basically set the width of the WEST component to zero and do a
relayout. If you want animation you decrease the width of the WEST
layout in several steps and do a relayout after every step.

Best,

Bram
Reply all
Reply to author
Forward
0 new messages