0
在我的小应用程序中,我有一个使用jQuery手机的嵌套列表。如果我点击列表中的某个项目,标题中的标题会更改并显示我点击的项目的标题。我怎样才能实现,标题停留在页面之前?jquery mobile:如何保持嵌套列表中标题的标题
例子:
<div data-role="page" id="newspage" data-theme="a">
<div data-role="header" data-position="fixed">
<a href="#home" data-role="button" data-icon="home" data-iconpos="notext" data-mini="true" data-inline="true" data-transition="slide" data-direction="reverse">Home</a>
<h1>News</h1>
</div>
<div data-role="content" id="newsList">
<ul data-role="listview">
<li>
<h2>News 1</h2>
<p>This is a short version of news 1</p>
<ul>
<li>
<h2>News 1</h2>
<p>This is the text of news 1</p>
</li>
</ul>
</li>
<li>
<h2>News 2</h2>
<p>This is a short version of news 2</p>
<ul>
<li>
<h2>News 2</h2>
<p>This is the text of news 2</p>
</li>
</ul>
</li>
</ul>
</div>
</div>
所以,如果我点击“新闻1”,在标题更改为“新闻1”,节目当然嵌套项目的标题。但是我想在嵌套项目的头部添加“新闻”,就像之前在头部div中定义的一样。我希望我明确我想要什么。 :-)任何想法如何做到这一点?
谢谢!
真棒!非常感谢你! – bbasmer