Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

three div side by side

$
0
0
This doesn't seem like it should be that hard, so if someone could just give me a kick in the right direction, that'd be awesome.
I have googled for two div bellow code :
 
<script type="text/javascript">
$(function() {
var right = $("#center");
$("#toggle").click(function() {
$("#left").animate({ "width": "toggle" }, {
duration: 250,
step: function() {
right.css("margin-left", $(this).width());
}
}, function() { right.css("margin-left", $("#left").width()); });
});
});
</script>
#left
{
width: 270px;
float: left;
border: solid 1px red;
}
#center
{
margin-left: 270px;
border: solid 1px green;
}
<script>
 
<divid="left">
       Test</div><divid="center">
       Test Right</div>
 
now guess that i have three div, i wanna to have same as above.
-------------------------------
|left div|center div|right div |
-------------------------------
the right and left div are always 170 px (for ex.)
and i wanna do that when my left div is empty my center div become bigger (same as below code)
and all three div should be side by side .and when my left div is empty the center div become bigger and right div be side of center div.
Thanks in advanced !

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>