轮播幻灯片和导航li更改之间的自举延迟

时间:2016-06-25 05:37:00

标签: javascript jquery html css twitter-bootstrap

我有一个像这样的引导旋转木马:

enter image description here

这是代码:

<div id="catCrsou" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner">
    <div class="item active">
      <img src="http://192.168.1.108/forushgah_datamanager//galleryPics/13073307011029.jpg" style="width: 100%;" onclick="">
    </div>
    <div class="item">
      <img src="http://192.168.1.108/forushgah_datamanager//galleryPics/24555488815560.jpg" style="width: 100%;" onclick="">
    </div>
  </div>
  <!-- End Carousel Inner -->
  <ul class="nav nav-pills nav-justified">
    <li class="bt active" data-target="#catCrsou" data-slide-to="0">
      <a href="#" title="عنوان مقاله" dir="rtl">عنوان مقاله</a></li>
    <li class="bt" data-target="#catCrsou" data-slide-to="1">
      <a href="#" title="عنوان 2" dir="rtl">عنوان 2</a></li>
  </ul>
</div>

这是javascripts代码

$(document).ready(function() {
  $('#catCrsou').carousel({
    interval: 4000
  });

  var clickEvent = false;
  $('#catCrsou').on('click', '.nav a', function() {
    clickEvent = true;
    $('.nav li').removeClass('active');
    $(this).parent().addClass('active');
  }).on('slid.bs.carousel', function(e) {
    if (!clickEvent) {
      var count = $('.nav').children().length - 1;
      var current = $('.nav li.active');
      current.removeClass('active').next().addClass('active');
      var id = parseInt(current.data('slide-to'));
      if (count == id) {
        $('.nav li').first().addClass('active');
      }
    }
    clickEvent = false;
  });

  $("#catCrsou li").hover(function() {
    var goto = Number($(this).attr('data-slide-to'));
    $("#catCrsou").carousel(goto);
  });
});

问题是大约2分钟后,旋转木马比导航丸更快地滑动并且有延迟。 我希望下一张幻灯片始终与导航丸改变同时进行。

我该如何解决?

1 个答案:

答案 0 :(得分:0)

试试这个 -

06-25 11:45:21.902 17298-17372/? I/DefaultRequestDirector: I/O exception (javax.net.ssl.SSLException) caught when processing request: Write error: ssl=0x8d334c00: I/O error during system call, Broken pipe
06-25 11:46:03.204 7086-7086/? I/dex2oat: dex2oat took 893.003ms (threads: 4) arena alloc=3KB (3288B) java alloc=2MB (2752008B) native alloc=3MB (3826768B) free=2MB (2464688B)
06-25 11:46:12.890 7234-7234/? W/MediaPlayer: Couldn't open content://com.android.providers.downloads.documents/document/545: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.downloads.DownloadStorageProvider from ProcessRecord{d912193 7234:[package name]/u0a116} (pid=7234, uid=10116) requires android.permission.MANAGE_DOCUMENTS or android.permission.MANAGE_DOCUMENTS
06-25 11:46:12.938 7234-7234/? D/MediaPlayer: create failed: