L15 (March 22): Coding Lab 2: jQuery Mobile

We will look into tools for building web-based interfaces that work well on mobile devices.  Most teams will need these tools for their projects.

Optional Readings:

Lecture Slides

Code:

<!DOCTYPE html>
<html>
<head>
 <title>Page Title</title>

 <meta name="viewport" content="width=device-width, initial-scale=1">

 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
 <script src="http://code.jquery.com/jquery-1.12.0.min.js"></script>
 <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>

<div data-role="page" id="home">

 <div data-role="header">
 <h1>TEST PAGE</h1>
 </div>

 <div data-role="content">
 <p>Page content goes here.</p>
 <div data-role="collapsible-set">Here
 <ul data-role="listview" data-inset="true"> <!-- play with data-inset -->
 <li><a href="http://acura.com">Acura</a></li>
 <li><a href="http://audi.com">Audi</a></li>
 <li><a href="http://bmw.com">BMW</a></li>
 </ul>
 </div>
 <br />
 <a href="http://google.com" class="ui-btn">Google</a>
 <a href="#contacts" class="ui-btn">Contacts (local link)</a>
 <button class="ui-btn">Button</button>
 </div><!-- /content -->

 <div data-role="footer">
 <h4>Footer</h4>
 </div><!-- /footer -->
</div><!-- /page -->

<div data-role="page" id="contacts">

 <div data-role="header">
 <h1>CONTACTS</h1>
 </div>

 <div data-role="content">
 <p>Here are my contacts.</p>
 <div data-role="collapsible-set">Here
 <ul data-role="listview" data-inset="true"> <!-- play with data-inset -->
 <li><a href="http://acura.com">Alice</a></li>
 <li><a href="http://audi.com">Steve</a></li>
 <li><a href="http://bmw.com">Wallace</a></li>
 </ul>
 </div>
 <br />
 <a href="http://google.com" class="ui-btn">Google</a>

 <a href="#home" class="ui-btn">Home (local link)</a>

 </div><!-- /content -->

 <div data-role="footer">
 <h4>Footer</h4>
 </div><!-- /footer -->
</div><!-- /page -->

</body>
</html>

About the author: Krzysztof Gajos

You must be logged in to post a comment.