Icon only back button jQuery Mobile

只愿长相守 提交于 2019-12-12 02:27:56

问题


Within my jQuery Mobile page I programmatically set up my back button to appear on every page that is not the first page by using the following code <div data-role="page" data-add-back-btn="true" id="anid"> what this does is create a back button that have text in it saying back. however I do not want that I want the icon only.

How can this be done in jQuery Mobile


回答1:


Working example: http://jsfiddle.net/Gajotres/ygmWD/

$(document).on('pagebeforeshow', function () {
    $.mobile.activePage.find(".ui-header a.ui-btn-left").addClass("ui-btn-icon-notext");
    $.mobile.activePage.find(".ui-header a.ui-btn-left").removeClass("ui-btn-icon-left");
});



回答2:


You can do this.

$(document).on('pagebeforeshow', function () {
 $(this).find('a[data-rel=back]').buttonMarkup({iconpos: 'notext'});
});

Demo




回答3:


for me this one worked:

data-iconpos="notext"

Example:

<a href="#" data-icon="back" data-rel="back" title="Regresar" data-iconpos="notext"></a>


来源:https://stackoverflow.com/questions/16227297/icon-only-back-button-jquery-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!