In order open a popup in your PhoneGap app based on Bootstrap, you have to perform the following steps:
A framework like Bootstrap makes it easy to define a modal window; all you have to do is add the CSS classes
modal
,hide
, andfade
into adiv
tag and assign to it an ID (for example,myModal
) that can be used as an anchor in thehref
attribute of the link you want to use to open the window.<div class="modal hide fade in" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <!-- All the tags needed to render the modal window here --> </div> </div>
In order to use the Apache Cordova APIs, you have to include the
cordova-3.x.y.js
file in theindex.html
file; it is also good practice to include the main JavaScript file and initialize the app.<script type="text/javascript" src="cordova.js"></script> <script...