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

u012746559 2013-11-12 04:30:32
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) {}
});
...全文
247 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
tangtangzizi 2014-01-26
  • 打赏
  • 举报
回复
引用 5 楼 u012746559 的回复:
唉,果然是顺序错了,低级失误,低级。 非常感谢!
你好,我想问下这个插件可以使用吗?是一个固定的效果,还是真正的进度,因为我看了几个模仿的,他就是等待文档加载完毕后就过一下这个动画,感觉这样在技术含量上不高,就是效果有点,请问这个是真正的浏览器进度吗?
「已注销」 2013-11-14
  • 打赏
  • 举报
回复
唉,果然是顺序错了,低级失误,低级。 非常感谢!
萧萧可乐 2013-11-13
  • 打赏
  • 举报
回复
楼上威武 我是过来捡分的
  • 打赏
  • 举报
回复
引用 1 楼 wg5945 的回复:
js加载的顺序调整下 <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" src="jquery.loadingbar.js"></script>
循序错了,你那个插件依赖jquery,一定要先倒入jquery
wg5945 2013-11-12
  • 打赏
  • 举报
回复
你用百度的话就不知道你想要什么效果了 呵呵~~
wg5945 2013-11-12
  • 打赏
  • 举报
回复
js加载的顺序调整下 <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" src="jquery.loadingbar.js"></script>

52,792

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧