Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to customize (or disable) the automatic "back" button in JQueryMobile

Is is possible to customize (or simply disable) the automatic "back" button in JQueryMobile ?

like image 357
david_p Avatar asked Mar 29 '11 19:03

david_p


2 Answers

I think you're looking for this:

http://jquerymobile.com/demos/1.0a3/#docs/toolbars/docs-headers.html

To disable it just include data-backbtn="false" in the header div of your page.

like image 159
Spike Avatar answered Sep 29 '22 20:09

Spike


To disable:

<div data-role="header" data-backbtn="false">

or

<div data-role="header" data-nobackbtn="true">

As far as customising goes, you can then create your own back button like this, which mimics the behavour of the original but lets you have more control over it:

<a href="#" data-rel="back" data-icon="arrow-l" data-theme="c" data-role="button">Back</a>

The automatic toolbar back button is now off by default in jQuery mobile Beta 1.

like image 30
CRice Avatar answered Sep 29 '22 19:09

CRice