我正在使用 jQuery mobile,我有一个长长的无序列表,如下所示:
<div id="wrapper" />
<div id="scroller" />
<div class="trans" />
<ul id="thelist" data-corners="false"
<div class="theListItem" data-role="collapsible-set" data-collapsed="false">
<div data-role="collapsible" class="my-collapsible" data-collapsed="false" data-theme="a" data-iconpos="right">
<h3>$111.58 - 10/30/2012 - McDonalds Restaurant - Chicago Il</h3>
<div data-role="controlgroup" data-type="horizontal">
<a class="green" href="categorize.html" data-transition="slide" data-direction="reverse" data-role="button">Yes</a>
<a class="red" href="#" data-role="button">Not deductible</a>
<a class="blue" href="IDontKnow.html" data-transition="slide" data-role="button">I don't know</a>
</div>
<div data-role="collapsible" class="my-collapsible" data-collapsed="false" data-theme="a" data-iconpos="right">
<h3>$111.58 - 10/30/2012 - McDonalds Restaurant - Chicago Il</h3>
<div data-role="controlgroup" data-type="horizontal">
<a class="green" href="categorize.html" data-transition="slide" data-direction="reverse" data-role="button">Yes</a>
<a class="red" href="#" data-role="button">No</a>
<a class="blue" href="IDontKnow.html" data-transition="slide" data-role="button">I don't know</a>
</div>
<div data-role="collapsible" class="my-collapsible" data-collapsed="false" data-theme="a" data-iconpos="right">
<h3>$111.58 - 10/30/2012 - McDonalds Restaurant - Chicago Il</h3>
<div data-role="controlgroup" data-type="horizontal">
<a class="green" href="categorize.html" data-transition="slide" data-direction="reverse" data-role="button">Yes</a>
<a class="red" href="#" data-role="button">No</a>
<a class="blue" href="IDontKnow.html" data-transition="slide" data-role="button">I don't know</a>
</div>
</div>
</ul>
</div>
</div>
</div>
而且,我正在努力做到这一点,以便当我单击任何列表项时,该列表项会突出显示并滚动到我的视口顶部,就在标题下方。有任何想法吗?