This recipe shows you how to use the $.mobile.changePage()
method to change from one page to another using JavaScript. This recipe extends the Using a split button list recipe from Chapter 6, List Views, and displays the selected image from the list item in a new page.
Copy the full code of this recipe from the code/09/changepage
source folder. Also, revisit the Using a split button list recipe from Chapter 6. You can launch this code by using the URL: http://localhost:8080/09/changepage/main.html
.
Create
main.html
with a split button list, with thehref
attribute for the<img>
tag having afile
parameter, with the path for the image file in the left button, as follows:<div data-role="content"> <ul data-role="listview" data-inset="true" data-theme="b" data-split-theme="e" data-split-icon="arrow-d"> <li> <a href="#viewphoto&file=img1.png"> <img style="margin: 10px...