「已注销」 2013-11-06 11:31 采纳率: 0%
浏览 1616

Github上一个模仿YouTube顶端进度条的jQuery实例,无法在本地部署。

Demo地址:http://www.thepetedesign.com/demos/youtube_loadingbar_demo.html
Github源码:https://github.com/peachananr/loading-bar

把他的源文件下载下来之后,按照说明上的用法,为什么没有效果?

<html>
<head>
<script type="text/javascript" src="jquery.loadingbar.js"></script>
<link rel="stylesheet" type="text/css" href="loadingbar.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
  $(document).ready(function(){
  $("#ajax-call").loadingbar({
    done: function(data) {
      $.each( data.shots, function( i, item ) {
        $( "<img/>" ).attr( "src", item.image_teaser_url ).prependTo( $("#frame") );
        if ( i === 11 ) {
          return false;
        }
      });
    }
  });
    });
    </script>
<style>
.reload{
  font-size: 14px;
  font-family: "微软雅黑";
  font-weight: bold;
  }
  </style>
</head>
<body>
<a id="ajax-call" href="http://www.baidu.com" class="reload">ajax-call</a>
<div id="frame"></div>
</body>
</html>

是不是下面的这些参数调用错了?

$(".ajax-call").loadingbar({
replaceURL: false, /* You can visibly change the URL of the browser to reflect the clicked links by toggling this to true. Default is false. May not work in old browsers. */
target: "#loadingbar-frame", /* The container's selector where you want the ajax result to appear. Default is #loadingbar-frame */
direction: "right", /* The direction where the the loading bar will progress. Default is right. */

/* Default Ajax Parameters.  */
async: true, 
complete: function(xhr, text) {},
cache: true,
error: function(xhr, text, e) {},
global: true,
headers: {},
statusCode: {},
success: function(data, text, xhr) {},
dataType: "html",
done: function(data) {}
});
  • 写回答

1条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2022-10-30 07:58
    关注
    不知道你这个问题是否已经解决, 如果还没有解决的话:

    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!