2012-03-26 30 views
4

我是jQueryMobile的新手。我有一個關於固定頭文件的問題。我在我的頭div中有這樣的代碼:如何使用jQueryMobile修復標題

<div data-role="header" hieght="100px" data-position="fixed" data-theme="a" style="min-height: 45px;"> 
    <h1>Nieuwspoort</h1> 
</div> 

在這個div中我已經把data-position =「fixed」。標題是固定的,但在我滾動頁面後,我的標題被隱藏,滾動後,我的標題再次變爲可見。

+0

您使用的是什麼版本的Jquery Mobile? – codaniel 2012-03-26 07:23:36

+0

這聽起來像一個重複檢查我aswer在這裏http://stackoverflow.com/questions/9829456/jquerymobile-fading-navbar – codaniel 2012-03-26 07:36:36

+0

@cadaniel我使用jQuery的手機版本1.7.1 – Aamirkhan 2012-03-26 07:37:33

回答

3

正確的固定頭支持已經從版本1.1-rc1開始引入jQueryMobile。

要解決你的標題請務必添加以下屬性

data-position="fixed" 

如果您想禁用點觸切換,然後添加修改工作如下

data-tap-toggle="false" 

你的引擎收錄例子:

<div data-role="header" data-position="fixed" data-tap-toggle="false" data-theme="a" style="min-height: 45px;"> 
    <h1>Nieuwspoort</h1> 
</div> 

您需要確保您使用1.1-rc1和jQuery 1.7.1

+0

大家好我通過查找iscroll jquery移動庫解決了問題。 – Aamirkhan 2012-03-26 08:58:40

+0

iscroll可以呈現它自己的問題,但是如果您使用的 2012-03-26 10:03:53