The header of a jQuery Mobile page usually contains the text which is to be used as the page header. You can also add other content and markup to the header. This recipe shows you how to add an image to the header of your application.
Copy the full code of this recipe from the code/03/header-image
sources folder. This code can be launched using the URL http://localhost:8080/03/header-image/main.html
.
In this recipe, the image ABC.png
is used as the logo image for a a fictitious company, ABC Inc.
Create
main.html
and add the above image to its header. The image is linked to a dialog as shown in the following code:<div id="main" data-role="page" data-theme="a"> <div data-role="header" data-theme="a"> <h1>ABC Company</h1> <a href="#about" data-rel="dialog" data-theme="a" class="ui-btn ui-shadow ui-btn-up-a"> <img src="../../resources/images/ABC.png" width="24" height="24" alt="About ABC"...