首先,是加入了 .mui-scroll-wrapper .mui-scroll 之后才有的问题。
问题描述:在A页面用href跳转到B页面,然后在B页面用mui-action-back后退到A页面,A页面自动滚动到顶部,而不是保留在点击链接B页面的位置。
描述如图:
代码如下:
《A页面》
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title">标题</h1>
</header>
<div id="pullrefresh" class="mui-content mui-scroll-wrapper" >
<div class="mui-scroll">
<ul class="mui-table-view">
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 1</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 2</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 3</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 4</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 5</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 6</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 7</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 8</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 9</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 10</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 11</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 12</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 13</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 14</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 15</a>
</li>
<li class="mui-table-view-cell">
<a href="test.html" class="mui-navigate-right">点击我跳转下一个页面</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">Item 17</a>
</li>
</ul>
</div>
</div>
<script type="text/javascript">
mui('.mui-scroll-wrapper').scroll();
</script>
《B页面》
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">标题</h1>
</header>
如图所示
求大神相助,这个是有在加入滚动条后才有的 我知道mui不适合开发WEB界面 需要结合用 但是现在这些东西我都需要用到,求大神相助。