Im using http://phase-change.org/jquery.gridlayout to achieve the fluid layout of several divs in my layout.
I need to keep a div on the right which contains my main menu the rest its just the content divs.
I cant figure out how to maintain the menu on the right without floating it or making the grid elements respected the menu and rearrange due to its width, they simply overlap.
My code is the following:
HTML:
<div id="menu">
</div>
<div id="content">
<div class="block">
<p>1</p>
</div>
<div class="block">
<p>2</p>
<p>2</p>
</div>
<div class="block">
<p>3</p>
<p>3</p>
<p>3</p>
<p>3</p>
</div>
<div class="block">
<p>4</p>
<p>4</p>
<p>4</p>
<p>4</p>
</div>
<div class="block">
<p>5</p>
<p>5</p>
<p>5</p>
<p>5</p>
<p>5</p>
<p>5</p>
<p>5</p>
</div>
<div class="block">
<p>6</p>
<p>6</p>
<p>6</p>
<p>6</p>
</div>
</div>
CSS:
#content.hasLayout {
position:relative;
margin-left:30px;
}
#block {
width:214px;
background-color:#CF0;
margin:30px 0 10px 0;
}
#menu {
width:180px;
height:700px;
background-color:#669;
float:right;
}
My JavaScript between the < head > and < /head >:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
<script type="text/javascript" src="JQuery_Plug_ins/jquery.gridlayout.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#content').addClass('hasLayout').gridLayout('div.block' , { col_widht:250, min_cols: 3 } );
});
</script>
I'm not very knowledgeable on java scripting and I really dont know even were to start looking how to implement it in that way.
Thank you.