jquery - 我如何在 jQuery Mobile 默认导航栏中有一个更大的中心底部导航栏按钮?

标签 jquery css jquery-mobile

我如何为 jQuery Mobile 网站在底部导航栏中制作一个更大的中心按钮? This is the effect I would like to have .

需要什么 CSS 和 jQuery 才能让按钮与我的应用程序的主窗口重叠,而不破坏我的导航栏?

最佳答案

这应该能让你很好地开始:

.ui-mobile .ui-page .ui-footer .ui-navbar .ui-btn.ui-btn-active {

    /*to make the active nav item stick-out we need to make it absolutely positioned*/
    position : absolute;

    /*this width is based on the number of nav items, 4 items means 25% for each*/
    width    : 25%;

    /*you can change this to however tall you want to make the active nav item*/
    height   : 50px;

    /*this places the active nav item at the same height as the rest of the nav items*/
    bottom   : -39px;

    /*normal nav items are z-index:10, so this will place the active one above the others*/
    z-index  : 11;

    /*this adds the top-left and top-right rounded corners*/
    -webkit-border-top-right-radius : 6px;
       -moz-border-top-right-radius : 6px;
            border-top-right-radius : 6px;
    -webkit-border-top-left-radius  : 6px;
       -moz-border-top-left-radius  : 6px;
            border-top-left-radius  : 6px;
    -webkit-background-clip : padding-box;
       -moz-background-clip : padding;
            background-clip : padding-box;

    /*this adds box shadow to the active nav item*/
    -webkit-box-shadow : 0 -1px 8px #000;
       -moz-box-shadow : 0 -1px 8px #000;
            box-shadow : 0 -1px 8px #000;
}

/*we need to override the default "overflow:hidden" for a couple elements so our active nav item doesn't get clipped*/
.ui-mobile .ui-page .ui-footer .ui-navbar,
.ui-mobile .ui-page .ui-footer .ui-navbar ul {
    overflow : visible;
}​

这是一个演示:http://jsfiddle.net/gNnDJ/

关于jquery - 我如何在 jQuery Mobile 默认导航栏中有一个更大的中心底部导航栏按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10251396/

相关文章:

jquery - asp.net web 表单的 super 菜单

javascript - jQuery 选择器工作但不影响图像大小

javascript - 添加 jQuery 验证方法时 this.optional(element) 做了什么?

css - 具有动态高度和页脚的模态窗口

jquery-mobile - 如何使用 backbone 动态导入 css?

jquery - 在引导数据表中分页后未触发行单击事件

html - 页脚没有粘在底部

javascript - 如何在特定位置启动 CSS3 动画?

jquery - 为什么 jQuery 与 jQuery Mobile 冲突?

javascript - jQuery Mobile - 保存用户输入的最佳方式是什么?