2012-12-03 33 views
2

我正在使用Windows Phone 7的Web瀏覽器控制,我想頁面內導航作爲鏈接無法在Windows手機網頁瀏覽器工作

<ul> 
<li> 
    <a href="#chapter-1_xhtml">Section 1</a> 
</li> 
<li> 
    <a href="#chapter-2_xhtml">Section 2</a> 
</li> 
</ul> 

然後我用

<a name="chapter-1_xhtml" id="chapter-1_xhtml"></a> 
...............The Div and other code.............. 
<a name="chapter-2_xhtml" id="chapter-2_xhtml"></a> 
...............The Div and other code.............. 

它的工作原理在桌面瀏覽器中完美,但是當我在Windows手機模擬器中運行相同的代碼時,它不工作,並在一個混蛋後停留在那裏。

Thanx提前。

回答

1

通過添加功能到HTML

function ScrollTo(Id) { 
     document.getElementById(Id).scrollIntoView(); 
    } 

,並呼籲按鈕,請單擊下面的代碼來實現我的目標。

this.webBrowser.InvokeScript("ScrollTo", "chapter-1_xhtml"); 
相關問題