jquery - adjusting width of a main div after hide/show of another div -
i have main div contains 2 divs. 1 main content , 1 sidebar content. sidebar content hidden/shown on clicking 1 link. when sidebar hidden, want content div occupy whole space container div. when sidebar content shown, should give space sidebar on left , adjust itself. here code. right implementing using jquery. not sure if there better way it. thanks
you're there. i've updated code. want put sidebar first, float them both left, , rid of width defined on main content.
<div id="container"> <div id="sidebar"> sidebar content </div> <div id="maincontent"> main content </div> </div> #maincontent { float: left; border: 1px solid green; height: 400px; } #sidebar{ float:left; width:200px; border: 1px solid blue; top:10px; height: 200px; }
Comments
Post a Comment