我必须使用谷歌地图 API 制作位置摘要。 map 上有对应航路点的字母,我有一个单独的<div>
包含所有路线信息。
现在我将其设置为 <ul>
,我想将其设为<ol>
与字母。但是,由于起始位置不包含在路线信息中,并且在 map 上有 A 标记,因此我的路线信息需要以 B 开头。
有办法做到这一点吗?
我尝试在其余项目之前使用 display: none
创建一个列表项.
我尝试使用start
属性。
我尝试使用value
属性与 JavaScript 数组结合使用。
<ol id="sortable" class="directions-panel list-container list" type="A">
<li style="display:none;"></li>
</ol>
<ol id="sortable" class="directions-panel list-container list" type="A" start="B"></ol>
<ol id="sortable" class="directions-panel list-container list" type="A">
<li value="B"></li>
</ol>
最佳答案
你很接近 - the start
attribute接受数字作为起始位置,无论列表显示字母还是数字。您所需要的只是start="2"
:
<ol id="sortable" class="directions-panel list-container list" type="A" start="2">
<li>one</li>
<li>two</li>
<li>three</li>
</ol>
关于javascript - 我可以制作一个从 B 而不是 A 开始的按字母顺序排列的列表吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56753182/