<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<linkrel="stylesheet"href="" />
<scriptsrc=""></script>
<scriptsrc=""></script>
</head>
<body>
<divdata-role="page"id="home">
<divdata-role="header">
<h1>Home</h1>
</div>
<divdata-role="content">
<ahref="#"data-role="button"data-theme="a">About this app</a>
<ahref="#"data-role="button"data-theme="b">About this app</a>
<ahref="#"data-role="button"data-theme="c">About this app</a>
<ahref="#"data-role="button"data-theme="d">About this app</a>
<ahref="#"data-role="button"data-theme="e">About this app</a>
</div>
</div>
</body>
</html>
事件
框架还提供了简单的用户接口,并添加了移动设备支持的特殊事件。
<!DOCTYPE html>
<html>
<head>
<title>jQuery Mobile Events</title>
<linkrel="stylesheet"href="" />
<scriptsrc=""></script>
<scriptsrc=""></script>
<scripttype="text/javascript">
$( function() {
$('body')bind( 'taphold', function( e ) {
alert( 'You tapped and held!' );
estopImmediatePropagation();
return false;
} );
$('body')bind( 'swipe', function( e ) {
alert( 'You swiped!' );
estopImmediatePropagation();
return false;
} );
} );
</script>
</head>
<body>
<divdata-role="page"id="home">
<divdata-role="header">
<h1>jQuery Mobile Events</h1>
</div>
<divdata-role="content">
<p>Try:</p>
<ul>
<li>Tapping and holding</li>
<li>Swiping</li>
</ul>
</div>
</div>
</body>
</html>
小结:jQuery Mobile入门学习文档的内容介绍完了,希望通过本文的学习能对你有所帮助!