Đây là mã html Tôi cóchân Đôi khi dai dẳng cũng di chuyển trong thời gian chuyển trang trong jquerymobile
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.css" />
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0b1/jquery.mobile-1.0b1.min.js"></script>
<script>
$('#home, #page2, #page3').live('pagebeforeshow',function(event){
$('#' + $(this).attr('id') + '_link').addClass('ui-btn-active');
});
</script>
</head>
<body>
<div data-role="page" id="home">
<div data-role="header" data-theme="b">
<h1>Test</h1>
</div>
<div data-role="content" data-theme="b">
Home Page
</div>
<div data-role="footer" data-position="fixed" data-id="pFooter">
<div data-role="navbar">
<ul>
<li><a href="#home" data-icon="custom" class="ui-btn-active" id="home_link">Home</a></li>
<li><a href="#page2" data-icon="grid">Second page</a></li>
<li><a href="#page3" data-icon="star">Third page</a></li>
</ul>
</div>
</div>
</div>
<div data-role="page" id="page2">
<div data-role="header" data-theme="b">
<h1>Test</h1>
</div>
<div data-role="content" data-theme="b">
Second page
</div>
<div data-role="footer" data-position="fixed" data-id="pFooter">
<div data-role="navbar">
<ul>
<li><a href="#home" data-icon="custom">Home</a></li>
<li><a href="#page2" data-icon="grid" class="ui-btn-active" id="page2_link">Second page</a></li>
<li><a href="#page3" data-icon="star">Third page</a></li>
</ul>
</div>
</div>
</div>
<div data-role="page" id="page3">
<div data-role="header" data-theme="b">
<h1>Test</h1>
</div>
<div data-role="content" data-theme="b">
Third page
</div>
<div data-role="footer" data-position="fixed" data-id="pFooter">
<div data-role="navbar">
<ul>
<li><a href="#home" data-icon="custom">Home</a></li>
<li><a href="#page2" data-icon="grid">Second page</a></li>
<li><a href="#page3" data-icon="star" class="ui-btn-active" id="page3_link">Third page</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
Vấn đề tôi đang phải đối mặt là đôi khi tôi thay đổi lựa chọn của navbar, chân cũng trượt sang trái hoặc ngay cùng với trang. Bạn có thể tạo lại vấn đề bằng cách liên tục thay đổi lựa chọn nút trong thanh điều hướng.
Bạn có thể nhìn thấy nó ở đây - http://jsfiddle.net/tKMgd/5/
Tôi nghĩ thanh cuộn dọc là thủ phạm. là nó luôn luôn ở đó? nó sẽ không có trên thiết bị di động, vì vậy bạn đã thử trên thiết bị chưa? Ngoài ra, bạn đã thử các chuyển đổi trang khác chưa? – Tsar
Nó ngẫu nhiên xảy ra. Đôi khi nó không xảy ra hoàn toàn.Tôi đã không thử nó trên thiết bị và đã không cố gắng chuyển tiếp khác. – user700284
Tôi cũng gặp vấn đề này. Bạn đã bao giờ tìm thấy một giải pháp? – John