2012-12-25 77 views
1

我已經在我的應用程序的所有頁面上成功實現了一個固定的導航欄,除了一個頁面。 此頁面包含100%高度和100%寬度的iframe。Jquery Mobile - Navbar在iframe中滾動後沒有修復

當我加載頁面時,一切正常。

What is should be always like

如果我滾動一切還是正常的。

但接下來,我點擊鏈接的iframe中

然後我滾動,導航欄和headerbar不滾動過程中不再固定。然後他們回到他們的位置。 enter image description here

下面是一些代碼來幫助你

<!DOCTYPE html> 
<html> 
<head> 
<title>My Page</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 
    <link rel="stylesheet" href="css/jqm-icon-pack-2.1.2-fa.css" /> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> 
</head> 
<body> 
<div data-role="page" id="boutique"> 
    <div data-role="header" data-position="fixed" data--tap-toggle="true"> 
     <h1>Boutique</h1> 
    </div> 
    <div data-role="content" style="padding:0px"> 
     <iframe style="width:100%; height:100%; border:0px; margin:0px" src="http://autotech.gazoline.net/index.php?mobile_theme_ok" rel="external"> 
     </iframe> 
    </div> 
    <div data-role="footer" data-id="myfooter" data-transition="pop" data-position="fixed" data-tap-toggle="true"> 
    <div data-role="navbar" data-grid="b"> 
    <ul> 
     <li><a href="#articles" data-icon="file">Articles</a></li> 
     <li><a href="#videos" data-icon="play">Vid&eacute;os</a></li> 
     <li><a class="ui-btn-active ui-state-persist" href="#boutique" data-icon="shopping-cart">Boutique2</a></li> 
    </ul> 
    </div> 
</div> 
</div> 

回答

0

我覺得在頭這個屬性讓這個

data--tap-toggle="true" 

你應該把它寫成頁腳

data-tap-toggle="true" 

你也不需要寫代碼,因爲de故障情況下,如果要禁用切換點擊時爲「真」 ,你應該讓「假」

問候

+0

您好,感謝您的回答。此代碼在那裏,因爲我曾嘗試將其設置爲false。 –

+0

以正確的格式將其設置爲false後會發生什麼,這是否解決了您的問題。 –

+0

不,我沒有解決我的問題。我試圖實現這一點:[鏈接](http://outof.me/native-scrolling-in-jquery-mobilephonegap-applications/)它幾乎奏效,但仍然沒有。所以現在,我只是隱藏這個網頁:( –