提交 00a6c6f3 编写于 作者: Y yadong.zhang

增加文章点赞的功能

上级 fcc06be3
......@@ -268,6 +268,30 @@ $(function () {
});
}
$("#social .like").click(function () {
var $this = $(this);
var $a = $(this).find("a");
var $count = $a.find("i.count");
var id = $a.data("id");
$.bubble.unbind();
$.ajax({
type: "post",
url: "/api/doPraise/" + id,
success: function (json) {
$.tool.ajaxSuccess(json);
if(json.status === 200){
$this.effectBubble({y:-80, className:'thumb-bubble', fontSize: 1, content: '<i class="fa fa-smile-o"></i>+1'});
$count.text(parseInt($count.text()) + 1);
}
$.bubble.init();
},
error: function () {
$.tool.ajaxError();
$.bubble.init();
}
});
});
$("img.lazy-img").lazyload({
placeholder : appConfig.staticPath + "/img/loading.gif",
effect: "fadeIn",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册