【发布时间】:2011-07-19 12:28:14
【问题描述】:
我对 $.mobile.changePage 方法有问题,事实上,当我用 phonegap 转换应用程序时,这个方法不起作用。
这是我的页面 .html 的代码。有解决办法吗?
页面索引.html
<!DOCTYPE html>
<html>
<head>
<title>Prova </title>
<link rel="stylesheet" href="css/jquery.mobile-1.0b1.css" />
<script src="js/jquery-1.6.1.min.js"></script>
<script src="js/jquery.mobile-1.0b1.js"></script>
<script>
$(document).ready(function() {
$('#linkpersonale').click(function() {
$.mobile.changePage("#personale", null, true, true);
});
});
</script>
</head>
<body>
<div data-role="page" id="home">
<header data-role="header">
<h1>Prova Page1</h1>
</header>
<div data-role="content" id="content">
<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b" data-counttheme="d">
<li>
<a class="ui-link-inherit" id="linkpersonale">
<h3 class="ui-li-heading">Personale</h3>
<p class="ui-li-desc">...</p>
</a>
</li>
</ul>
</div>
<footer data-role="footer" data-role="footer" data-id="footer-nav" data-position="fixed">
<div data-role="navbar" id="navbar_home">
<ul>
<li><a href="#home" data-icon="home" data-iconpos="top" data-theme="a">Home</a></li>
</ul>
</div>
</footer>
</div>
</body>
</html>
页面personale.html
<!DOCTYPE html>
<html>
<head>
<title>Prova </title>
</head>
<body>
<div data-role="page" id="personale">
<header data-role="header">
<h1>Prova Pag2</h1>
</header>
<div data-role="content">
<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="b" data-counttheme="d">
<li>
<a class="ui-link-inherit" href="#">
<h3 class="ui-li-heading">Etc etc</h3>
<p class="ui-li-desc">...</p>
</a>
</li>
</ul>
</div>
<footer data-role="footer" data-role="footer" data-id="footer-nav" data-position="fixed">
<div data-role="navbar">
<ul>
<li><a href="#" data-icon="home" data-icon="home" data-iconpos="top" data-theme="a" data-transition="slide">Home</a></li>
</ul>
</div>
</footer>
</div>
</body>
</html>
一些建议? PS:对不起我的英语,我是意大利人;)
【问题讨论】:
-
你能粘贴
changePage函数吗? -
添加了 jquery-mobile 标记,希望能将一些 JQuery Mobile 人带到这里来。
标签: jquery mobile jquery-mobile cordova