jquery - Bootstrap 3 - Collapsible right-side panel like Google Drive Details/Activity panel -
working on new web layout our existing product. we'd integrated team chat , activity feed displays consistently displayed on right side of each page. we're using bootstrap 3 , i've got mock looks pretty good. i'm using vanilla bootstrap 12-column sizing styles this:
now want allow users collapse right-side panel (horizontally), views horizontal real estate important (grid views, etc.).
is there bootstrap way this? i'm fine vertical splitter widget, or toggle button in top nav, or whatever other presentation makes sense. it's more grid sizing need advice on.
i had needed similar approach 1 of our projects , fullscreen view here.
i modified script , layout bit trying achieve. here code , fullscreen here. used jquery cookie retain view state after page refresh. clicking on cog icon toggle sidebar. script is:
$(function () { var $menu = $('#sidebar-wrapper'); var $content = $('#main-wrapper'); if ($.cookie('offcanvas') == 'hide') { $content.addclass('no-transition'); $menu.hide(); $menu.css('right', -($menu.outerwidth() + 10)); $content.removeclass('col-md-10').addclass('col-md-12'); } else if ($.cookie('offcanvas') == 'show') { $menu.show(500).animate({ right: 0 }); // $menu.show(); $content.removeclass('no-transition'); $content.removeclass('col-md-12').addclass('col-md-10'); } $('.toggle-button').click(function () { $content.removeclass('no-transition'); if ($menu.is(':visible') && $content.hasclass('col-md-10')) { // slide out $menu.animate({ right: -($menu.outerwidth() + 10) }, function () { $menu.hide(1000); }); $content.removeclass('col-md-10').addclass('col-md-12'); $.cookie('offcanvas', 'hide'); } else { // slide in $menu.show(500).animate({ right: 0 }); $content.removeclass('col-md-12').addclass('col-md-10'); $.cookie('offcanvas', 'show'); } if ($content.hasclass('col-md-12') && $menu.is(':hidden')) { $menu.animate({ right: 0 }, function () { $menu.show(1000); }); // $menu.show(); $content.removeclass('no-transition'); $content.removeclass('col-md-12').addclass('col-md-10'); } }); $('.bs-tooltip').tooltip(); });
you can customize layout/css wanted get.
Comments
Post a Comment