How to make GridStack vertically responsive?
The plugin is responsive with width. But how can we make it responsive to height of browser?
If we want to make it to show 6 grid always whenever the person opens in any device?
I solved this issue changing the line 522 in gridstack.js to :
'height: ' + ((this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i))/7.7 + '%;',
and changing the 537 line in gridstack.js to :
'top: ' + ((this.opts.cell_height * i + this.opts.vertical_margin * i))/7.7 + '%;',
and in your own CSS file give property to container:
.gridstack{
height: 100% !important;
}
now the grid will work with any height !
hi @McQuinTrix , can you please specify the line number in new gridstack.js 0.2.4-dev.
is it 567 & 582 ?
Thanks.
@marshmeloo In this file: https://github.com/troolee/gridstack.js/blob/master/src/gridstack.js
572nd line where 'height' of individual box is being set
&
587th line where 'top' is being set for individual box
But, this gave me height responsive for 3 column and 2 rows, if you want to do it for more rows you will have to tinker with the 7.7 that I am multiplying .. Hope you understand..