jquery-mobile – Jquery Mobile – 页面转换速度慢

前端之家收集整理的这篇文章主要介绍了jquery-mobile – Jquery Mobile – 页面转换速度慢前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
使用 jquery mobile Im使用持久性页眉和页脚.页脚导航具有选项卡,当您单击选项卡时,它会通过ajax加载页面.问题是从一个页面转换到另一个页面,这是ajax加载具有特定id的div,非常慢.页面转换需要2-5秒才能完成.当我点击一个标签时,它突出显示不同的颜色,但没有任何反应,然后几秒钟后发生转换.有时,如果您单击以快速布局中断并且页脚消失.我在ipad上使用最新版本的jquery mobile进行此操作. jquery移动版真的很慢吗?等到ios5会有所不同吗?

UPDATE

这是一段代码

<div data-role="page" id="page1">
  <div data-role="header" data-position="fixed">
    <h1>Page Title</h1>
    <a href="#dialog" data-transition="slidedown" data-icon="check">Add</a>
  </div>
  <div data-role="content">
    <ul data-role="listview">
      <li data-role="list-divider"><span class="ui-li-count">2</span></li>
      <li>
        <h3>Stephen Weber</h3>
        <p><strong>You've been invited to a meeting at Filament Group in Boston,MA</strong></p>
        <p>Hey Stephen,if you're available at 10am tomorrow,we've got a meeting with the jQuery team.</p>
        <p class="ui-li-aside"><strong>6:24</strong>PM</p>
      </li>
</ul>
  <div data-role="footer" class="nav-glyphish-example" data-id="myfooter" data-position="fixed"> 
    <div data-role="navbar" class="nav-glyphish-example" data-grid="b">
      <ul>
        <li><a href="#page1" data-transition="reverse slide" id="chat" data-icon="custom" class="ui-btn-active ui-state-persist">Link 1</a></li>
        <li><a href="#page2" data-transition="slide" id="email" data-icon="custom">Link2</a></li>
        <li><a href="#page3" data-transition="slide" id="skull" data-icon="custom">Link 3</a></li>
      </ul>
    </div>
  </div>

<div data-role="page" id="page2">
  <div data-role="header" data-position="fixed">
    <h1>Page Title</h1>
    <a href="#dialog" data-transition="slidedown" data-icon="check">Add</a>
  </div>
  <div data-role="content">
    <ul data-role="listview">
      <li data-role="list-divider"><span class="ui-li-count">2</span></li>
      <li>
        <h3>Stephen Weber</h3>
        <p><strong>You've been invited to a meeting at Filament Group in Boston,we've got a meeting with the jQuery team.</p>
        <p class="ui-li-aside"><strong>6:24</strong>PM</p>
      </li>
</ul>
  <div data-role="footer" class="nav-glyphish-example" data-id="myfooter" data-position="fixed"> 
    <div data-role="navbar" class="nav-glyphish-example" data-grid="b">
      <ul>
        <li><a href="#page1" data-transition="reverse slide" id="chat" data-icon="custom" class="ui-btn-active ui-state-persist">Link 1</a></li>
        <li><a href="#page2" data-transition="slide" id="email" data-icon="custom">Link2</a></li>
        <li><a href="#page3" data-transition="slide" id="skull" data-icon="custom">Link 3</a></li>
      </ul>
    </div>
  </div>

解决方法

Sometimes if you click to fast the layout breaks and the footer
dissappears:

这是一个已经存在的问题,尚未找到解决方案:https://stackoverflow.com/questions/7484522/jquerymobile-click-on-background-fires-event-header-footer-data-position-fixe

关于加载时间,它真的很奇怪,尝试通过删除部分代码来集中错误并缩小发生长加载时间的地点和原因…希望这会有所帮助.

原文链接:https://www.f2er.com/jquery/178450.html

猜你在找的jQuery相关文章