我正在嘗試在我的JQuery Mobile應用程序的頭文件中使用自定義圖標。我試圖使用的特定圖標就是來自Glyphish(http://glyphish.com/)的「play」圖標。當我嘗試在標題中的右側按鈕中使用它時,如下所示: http://jquerymobile.com/demos/1.1.0-rc.1/docs/toolbars/docs-headers.html,我的圖標顯得很奇怪。我似乎無法在我的標題欄中獲得簡單的「播放」按鈕。這是我的代碼:JQuery Mobile Header中的自定義圖標
<style type="text/css">
.navbar .ui-btn .ui-btn-inner { padding-top: 40px !important; }
.navbar .ui-btn .ui-icon { width: 30px!important; height: 30px!important; margin-left: -15px !important; box-shadow: none!important; -moz-box-shadow: none!important; -webkit-box-shadow: none!important; -webkit-border-radius: 0 !important; border-radius: 0 !important; }
#custom .ui-icon{ background: url(/images/play.png) 50% 50% no-repeat; background-size: 24px 22px; }
</style>
<div id="myPage" data-role="page" data-dom-cache="false">
<div data-role="header">
<h1>My Title</h1>
<a id="play" href="#" data-icon="custom" data-iconpos="notext" class="ui-btn-right jqm-plus">Continue</a>
</div>
<div data-role="content">
<!-- page content goes here -->
</div>
</div>
有人可以告訴我如何解決這個問題嗎?
奇,與像@JQuery移動用戶名,我想你將有答案。 – shanabus 2012-03-11 03:16:20
「codaniel」試圖說的不是你以後的樣子。他試圖解釋按鈕自定義圖標,但我意識到你正在尋找的是Navbar自定義圖標。 看到這篇文章: http://stackoverflow.com/questions/6243871/glyphish-icons-display-in-jquery-mobile – 2012-09-04 01:03:27