JackSong
JackSong
  • 发布:2018-06-27 17:07
  • 更新:2018-06-27 18:52
  • 阅读:4408

mui-scroll-wrapper 滚动导航 如何默认到指定位子

分类:MUI

<div class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
<div id="slider" class="mui-scroll">
<a data-where="1" class="mui-control-item a1">1</a>
<a data-where="2" class="mui-control-item a2">2</a>
<a data-where="3" class="mui-control-item a3">3</a>
<a data-where="4" class="mui-control-item a4">4</a>
<a data-where="5" class="mui-control-item a5">5</a>
<a data-where="6" class="mui-control-item a6">6</a>
<a data-where="7" class="mui-control-item a7">7</a>
<a data-where="8" class="mui-control-item a8">8</a>
<a data-where="9" class="mui-control-item a9">9</a>
<a data-where="10" class="mui-control-item a10">10</a>
<a data-where="11" class="mui-control-item a11">11</a>
<a data-where="12" class="mui-control-item a12">12</a>
<a data-where="13" class="mui-control-item a13">13</a>
<a data-where="14" class="mui-control-item a14">14</a>
<a data-where="15" class="mui-control-item a15">15</a>
<a data-where="16" class="mui-control-item a16">16</a>
<a data-where="17" class="mui-control-item a17">17</a>
<a data-where="18" class="mui-control-item a18">18</a>
<a data-where="19" class="mui-control-item a19">19</a>
<a data-where="20" class="mui-control-item a20">20</a>
<a data-where="21" class="mui-control-item a21">21</a>
<a data-where="22" class="mui-control-item a22">22</a>
<a data-where="23" class="mui-control-item a23">23</a>
<a data-where="24" class="mui-control-item a24">24</a>
<a data-where="25" class="mui-control-item a25">25</a>
<a data-where="26" class="mui-control-item a26">26</a>
<a data-where="27" class="mui-control-item a27">27</a>
<a data-where="28" class="mui-control-item a28">28</a>
<a data-where="29" class="mui-control-item a29">29</a>
<a data-where="30" class="mui-control-item a30">30</a>
<a data-where="31" class="mui-control-item a31">31</a>
</div>
</div>

如何 初始进来 比如说到 27 页面js如何指定让滚动条到27这个位子?

2018-06-27 17:07 负责人:无 分享
已邀请:
洛上千栀

洛上千栀

document.getElementById("id").offsetTop//获取某标签高度

mui('.mui-scroll-wrapper').scroll().scrollTo(x轴,Y轴,100);//100毫秒

不过这两个值有差别
-(document.getElementById("id").offsetHeight-450) 差多就是scroll的y轴的值(负数)

  • JackSong (作者)

    横向的呢~如何计算让默认值在屏幕中间

    2018-06-28 14:49

  • 1***@qq.com

    回复 JackSong: 解决了吗,我现在也是遇到这个问题,横向的

    2019-10-17 14:29

该问题目前已经被锁定, 无法添加新回复