css - Is it possible to have a "fixed sidenav"and a scrolling left side using angular-material? -
i've been trying work through last few hours , cannot working. trying create 3 columns, let's call them columns a, b, c.
column , b scroll 1 unit , take full height of site. column c scroll independently , not scroll when column , b scrolled.
unfortunately, cannot create setup meets of conditions , maintains full height.
in plnkr below can see green , gray sections should full height not. feel it's close last bit driving me nuts!
http://plnkr.co/edit/jppzhflp3e1fgnvdlfqd?p=preview
<body layout="row" style="min-height:100%" > <md-content flex layout="row" layout-fill> <div class="side-a" flex layout-fill> <p>lots of content requires scrolling...</p> </div> <div class="middle" flex layout-fill> <p>lots of content requires scrolling...</p> </div> </md-content> <md-sidenav layout-fill flex layout="column" class="md-sidenav-left md-whiteframe-z2 side-b" md-component-id="left> <p>lots of content requires scrolling...</p> </md-sidenav> </body> thanks. appreciated.
one solution wrap column content in div inside of columns , use relative/absolute positioning. i.e.
<md-content flex layout="row" layout-fill> <div flex layout-fill style="position: relative;"> <div class="side-a" style="position: absolute; width: 100%;"> <p>lots of content requires scrolling...</p> </div> </div> <div flex layout-fill style="position: relative;"> <div class="middle" style="position: absolute; width: 100%;"> <p>lots of content requires scrolling...</p> </div> </div> </md-content> note classes have moved column inner div.
this works because absolute positioned div expand fit content within it. downside method if 1 column shorter other shorter column wont span remaining height.
Comments
Post a Comment