doulai2573 2013-07-23 23:19
浏览 37
已采纳

用于通过twitter bootstrap显示左侧菜单的页面幻灯片

I'm trying to emulate or find a plugin that slides the page over exposing a navigation menu like this twitter bootstrap template:

If you resize the page you'll see the option in the header row to slide the page over.

I've looked through the javascript code but don't see how this is accomplished.

I also found this git project for pageslide but it slides the entire page.

Any idea how this bootstrap page slides the menu out for smaller resolution devices?

  • 写回答

2条回答 默认 最新

  • dpjpo746884 2013-07-23 23:41
    关注

    It's basically page structure and some css3 transforms/styles.

    <div id="wrap">
        <div id="menu" role="navigation"></div>
        <div id="main" role="main"></div>
    </div>
    

    The page uses media queries to set styles based on available screen real-estate and applying the style js-menu to the html element:

    When open (abbreviated):

    @media screen and (max-width: 950px)
        .js-advanced.js-menu #wrap {
            -webkit-transform: translate3d(280px, 0, 0);
        }
    

    When closed (abbreviated):

    @media screen and (max-width: 950px)
        .js-advanced #wrap {
            -webkit-transition: -webkit-transform 500ms ease;
            -webkit-transform: translate3d(0, 0, 0);
        }
    

    In this case, the entire #wrap element is being shifted over.

    I've created a gist for a very simple/stripped down version of a page that has basic support for both newer and some older browsers. I did not add media query support. Media query support can be added for older browser via libraries like respondjs.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘