2012-02-14 69 views
4

我已經瀏覽了stackoverflow上的其他帖子,但他們似乎對於這樣一個簡單的任務來說太複雜了。jquery mobile fixed(always on top)標題

我想要做的就是在我的移動應用程序頂部有一個固定的標題,即使在滾動「listview」時,它也會始終保持在那裏。請告訴最簡單的方法來實現這一點。現在,當我向下滾動標題時,確實會出現,但是點擊它之後就會消失。我怎麼才能破解這個jQuery的消失行爲? 謝謝!

我有這樣的:

<!DOCTYPE html> 
<html> 
<head> 
<title>Testing Jquery</title> 

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

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

<body> 
<div data-role="page"> 

<div data-role="header" data-position="fixed"> 
    <h1>Page Title</h1> 
</div><!-- /header --> 

<div data-role="content"> 
    <ul data-role="listview" data-theme="g"> 
     <li><a href="#">Item1</a></li> 
     <li><a href="#">Item2</a></li> 
     <li><a href="#">Item3</a></li> 
    </ul> 
</div><!-- /content --> 

</div><!-- /page --> 
</body> 
</html> 
+0

二,同樣的問題,在這裏回答: http://stackoverflow.com/questions/6925246/in-jquery-mobile-header-and-footers-are-always-hiding-when-clicking-裏面-the http://stackoverflow.com/questions/6962961/jquery-mobile-static-footer-navbar – zigomir 2012-03-08 20:34:57

回答