【问题标题】:A bottom navbar in jQuery mobile looking like iPhone navbar, possible?jQuery mobile 中的底部导航栏看起来像 iPhone 导航栏,可能吗?
【发布时间】:2011-06-10 07:13:19
【问题描述】:

我使用 jQuery mobile 创建了我的网站,我想构建与下图所示相同的底部工具栏。有人能指出我正确的方向吗?

jQuery mobile 提供的默认导航栏没有提供相同的外观。

这里是 jQuery 移动导航栏:http://jquerymobile.com/test/#/test/docs/toolbars/docs-navbar.html

【问题讨论】:

  • 是的,有可能(为什么不呢?)但你必须自己写一些 CSS
  • @naugtur:我以为有什么可以开始的……我自己试试。
  • 只有你链接到的例子。拿来加样式,就可以得到视觉效果了。

标签: jquery jquery-mobile


【解决方案1】:

您可以使用的图标:http://glyphish.com/

快速直播版本:http://jsfiddle.net/vh4Ca/62/

HTML

<div data-role="page">  
    <div data-role="content"> 
        <div data-role="footer" class="nav-glyphish-example"> 
            <div data-role="navbar" class="nav-glyphish-example" data-grid="d"> 
            <ul> 
                <li><a href="#" id="favorite" data-icon="custom">Favorite</a></li> 
                <li><a href="#" id="recent" data-icon="custom">Recent</a></li> 
                <li><a href="#" id="contacts" data-icon="custom">Contacts</a></li> 
                <li><a href="#" id="keypad" data-icon="custom">Keypad</a></li> 
                <li><a href="#" id="voicemail" data-icon="custom">Voicemail</a></li> 
            </ul> 
            </div> 
        </div> 
     </div>
 </div> 

CSS

.nav-glyphish-example .ui-btn .ui-btn-inner {
    padding-top: 40px !important; 
}

.nav-glyphish-example .ui-btn .ui-icon { 
    width: 45px!important; 
    height: 35px!important; 
    margin-left: -24px !important; 
    box-shadow: none!important; 
    -moz-box-shadow: none!important; 
    -webkit-box-shadow: none!important;
    -webkit-border-radius: none !important;
    border-radius: none !important; 
}

#favorite .ui-icon { 
    background-image: url(http://glyphish.com/images/demo.png);
    background-position: -345px -112px;
    background-repeat: no-repeat;
}

#recent .ui-icon { 
    background-image: url(http://glyphish.com/images/demo.png);
    background-position: -9px -61px;
    background-repeat: no-repeat; 
}

#contacts .ui-icon { 
    background-image: url(http://glyphish.com/images/demo.png);
    background-position: -9px -540px;
    background-repeat: no-repeat; 
}

#keypad .ui-icon { 
    background-image: url(http://glyphish.com/images/demo.png);
    background-position: -9px -783px;
    background-repeat: no-repeat; 
}

#voicemail .ui-icon { 
    background-image: url(http://glyphish.com/images/demo.png);
    background-position: -394px -733px;
    background-repeat: no-repeat; 
}

【讨论】:

  • 我在寻求调酒师帮助时偶然发现了这一点 - 这更简单,更容易定制。
  • 一件事 - 你的小提琴显示的是纯黑色背景的图标,看起来有点不对劲
  • @JoshL 是的,这只是一个例子,但它也困扰着我
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-07
  • 1970-01-01
  • 2018-11-27
  • 1970-01-01
相关资源
最近更新 更多